14. Case 06 -Use Joystick:bit to Control the XGO

14.1. Purpose

Control the XGO with the Joystick:bit, please visit [Joystick:bit](14. Joystick:bit V2 — micro bit tutorial (elecfreaks.com)) for more information.

14.2. Materials

1 × micro:bit XGO Robot Kit

1 × joystick:bit kit

14.3. Hardware Connections

Connect the micro:bit with the computer through the USB cable.

../../_images/microbit-xgo-robot-kit-22.png

14.4. Software Platform

Makecode

../../_images/microbit-xgo-robot-kit-10.png

14.5. Programming

Add the XGO extension:

../../_images/microbit-xgo-robot-kit-11.png

../../_images/microbit-xgo-robot-kit-12.png

../../_images/microbit-xgo-robot-kit-13.png

../../_images/microbit-xgo-robot-kit-14.png

14.6. Code

Samples:

Program the Joystick:bit

../../_images/microbit-xgot-robot-kit-case06-out-of-the-square-01.png

Program XGO

../../_images/microbit-xgot-robot-kit-case06-out-of-the-square-02.png

Link: Joystick program

Or you can download it directly:

Link: XGO Program

Or you can download it directly:

14.7. FAQ

If XGO doesn’t walk, check the power status of the XGO and the Joystick:bit.

14.8. Exploration

Can we control the XGO with the C/D/E/F buttons on the Joysitck:bit?