14. Case 11-The Never Lost Directions XGO#

../../_images/3.png

14.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!

14.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.

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

14.3. MakeCode Programming#


Step 1#

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

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

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.

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

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

../../_images/xgo-11-1.png

Sample Code#

../../_images/xgo-11-2.png

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

Exploration#

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