4. Units Operation

1. Angle Sensor

556 views 2019-03-07 2019-03-13 peterletintech 3

Hardware requirement

  • M5GO
  • Angle sensor
  • Connecting wire

The Angle sensor is a sensor that can read values ​​from 0.0 to 100.0 depending on the angle of the knob.

 

In Micropython, you create an instance of the ANGLE class as follows and read (), you can read the value according to the angle of the knob at that time. When you create an instance, the pin corresponding to Grove port B is secured. At the end of the program call deinit () and release the reserved pin.

 

How to use the units

Step 1. In UI flow – screen part, create the unit “ANGLE” for port B.

Step 2. In coding part, click Units, select Angle, there is the coding for getting the value from the angle sensor.

Step 3. Finish the code and execute it.

Step 4. The value changes according to the rotation of the angle sensor. (Click the graph to see the changes)

Was this helpful?