Potentiometers
The potentiometer (also known as pot) is a commonly used analog device. It is a three-pin device that offers variable resistance with the help of the middle pin. To connect it with Micro:bit, as depicted in Figure 9.2, we need to join the middle pin of a potentiometer to the analog pin and side pins to the power and ground:
Figure 9.2 – Connecting a potentiometer to Micro:bit using P0
Once the connections are made, as shown in Figure 9.2, then the Micro:bit needs to be programmed, and the values from the potentiometer can be read for further use. As depicted in Figure 9.2, the potentiometer has three pins: one pin is connected to the ground and another is associated with the supply voltage; in the case of Micro:bit, it supplies 3 V of power. The middle pin is the point of consideration in the circuit connection, and it could be connected to any analog pin, such as pins 0, 2, 3, 4, and 10. The changes will be made in the program based on...