port: |
Grove: A1 (C16, C17) |
interface: | analog |
output values |
1 - 1019 |
Further information: | https://wiki.seeedstudio.com/Grove-Rotary_Angle_Sensor/ |
A rotatable input knob (potentiometer) that can be turned up to 300° and produces a linear analog output between 0 and the operating voltage (3.3 V). This is distributed by the analog-digital converter of the Calliope mini in the value range between 0 and 1023.
Makecode
In MakeCode you can output the values of the Grove potentiometer via RX pin C16. To do this, go to the advanced blocks Pins and select the block analog values of pin P1 and change the pin accordingly to C16.
Since you usually want to permanently query the rotation of the potentiometer, the output should be in a permanent loop.
Map numbers
It may be useful to map the numbers from the range of values of the potentiometer into a new range of values, depending on the application. Under the category Mathematics you can find the block distribute 0 from low 0 from high....
You can find sensor and actuator projects that have already been realised on the project page.