# Case 11-The Never Lost Directions XGO ![](./images/3.png) ## 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! ## Quick to Start --- ### Materials Required [micro:bit XGO Robot Kit ](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-xgo-robot-kit?_pos=1&_sid=c796ff3f3&_ss=r) × 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) ## 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](https://makecode.microbit.org/_YYDh669TLXfp) 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?