Skip to main content

Sugar Potentiometer

The potentiometer contains an adjustable resistor. By rotating the knob, the resistance value is changed, thereby controlling the output voltage. Its adjustable angle range corresponds to the return value, making it suitable for applications such as adjusting light brightness or servo angles. The output is an analog value.
image.png

Parameters


Size24 x 24 x 30 mm
Weight6.7 g
SignalAnalog Input
Range0~3.3V Corresponds to Micro:bit 0~1023
Adjustable Angle270°

Wiring


Connect the light sensor module to P1 on the Robotbit Edu using a 3-pin terminal cable.

(Only P0, P1, and P2 pins can be used, as they support analog read functionality.)

After turning on the Robotbit power, you will see the red light at the bottom of the light sensor module illuminate (indicating the module is powered normally).)
![image.png](方糖 电位器.assets/1631619650951-7fdc8b1b-8885-4fa3-a598-e49755c38551.png)

Programming

#Potentiometer controls the number of lit

Rotate the potentiometer, and the number of lit LEDs on the Micro:bit's dot matrix will increase accordingly.

Here, an advanced operation block 【Mapping】 is used:
![image.png](方糖 电位器.assets/1633605681246-b60ed3b8-afc7-4fae-9e9c-a73762b8af24.png)

点阵.png