2-Axis Joystick
2-Axis Joystick
The 2-Axis Joystick’s position is measured by two potentiometers, one for the forward and backward motion and the other for left and right.
Parts
(1) 2-Axis Joystick 27800
(2) Resistor 220 Ω (red-red-brown-gold)
Jumper wires: (2) Red, (1) black
Schematic
Wiring
Script – Vertical and Horizontal Voltages
Tests
Use the previous program at the beginning of this section to measure the sensor’s voltage output.
After loading the script into the micro:bit, click Show serial in the micro:bit Python Editor. There, you will see the voltage measurements updated every second.
Script – Joystick Matrix Pixel Control
Tests
Verify that the “pixel” on the micro:bit module’s 5×5 LED matrix display lights up and indicates the position of the joystick.