HOW to Use Joystick with Microbit
Overview
For some DIY projects, you perhaps use a component, that is, joystick module, such as game joysticks. How could they operate?
In this lesson, you will learn how to control a joystick module and micro:bit shield to display the data on serial monitor.
Components Required
-
Micro:bit main board*1
-
Keyestudio Micro bit Sensor V2 Shield*1
-
USB Cable*1
-
keyestudio Joystick Module*1
-
Dupont jumper wire*5
-
Premium Battery Holder 6-cell AA*1
-
1.5V AA Battery*6
Connection Diagram
Test Code
Test Results
Wire up according to connection diagram. plug in external power and upload code to micro:bit. Open CoolTerm, click Options and select SerialPort, set COM port and baud rate(115200). Click OK and Connect.
If you operate the joystick, the analog value on X, Y and Z will change, as well as pin B, as shown below: