Try controlling your robotic vehicles or projects with the MB2 expansion joystick. You can try programming the joystick and four buttons to control a simple robotic vehicle with a gripper, for example. Or you can try our mini-games to pass the time, wherever you are.
Carefully connect the joystick using the connector on the bottom of the joystick board to the top of the MB2 motherboard expansion pins.
To achieve a correct connection, make sure that the holes in the expansion board and the joystick are aligned, see the picture. When connecting, do not apply too much pressure to the boards, as this may cause damage.
Working with the joystick
The joystick itself is electrically connected to the micro:bit pins P1 and P2.
We will use blocks to work with the joystick analog read. The joystick can be used in different modes for control. We can decide whether we will evaluate specific positions or control our application linearly.
Working with buttons
Working with the buttons on the joystick is a bit more challenging than working with the buttons on the micro:bit itself. However, it is not a problem to master this application if you know how to do it.
To control the buttons, we will use "pullUP" blocks on specific pins of the micro:bit. We will then read the logic states on the buttons.