15. Case 11-The Never Lost Directions XGO#


15.1. Introduction#

Hi guys, when we get lost in some unfamiliar places, the XGO can guide us with the correct routine if you’ve learnt this project, let’s see how it works in this project!

15.2. Quick to Start#

Materials Required#

micro:bit XGO Robot Kit × 1

Working Principle#

  1. The micro:bit has a compass sensor which is used to measure magnetic fields. It senses the earth’s magnetic field, and you can use it as a compass.

  2. When using the micro:bit compass for the first time, it must be calibrated. A small game will appear on the screen where you have to tilt the micro:bit to light up each LED and it will be ready to use.

Hardware Connections#

Connect the micro:bit with the computer through the USB cable. I believe you are already very skilled.


15.3. MakeCode Programming#

Step 1#

Click ” Advanced“ in the MakeCode drawer to see more choices.


We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “XGO” in the dialogue box to download it.


Note: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.

Step 2#

The directions diagram


Sample Code#


Link: The XGO Guide

You may download it directly below:

Projects Display#

Relevant Questions#

If the XGO does not travel in the correct north direction, recalibrate the magnetometer or calibrate the XGO


Is it possible to make the XGO wait us in a place when the XGO has gone too far?