MICROBIT PROJECT
COMPASS ANGLE

separator-blank.png

DESCRIPTION

Students will learn how to get a compass reading from the Microbit.  Angle zero is pointing north.  Angle 90 is east.  Angle 180 is south and angle 270 is west.

Important note: When you download a program that uses the compass onto the Microbot, a calibration program automatically starts saying “Tilt to Fill the Screen”.  You need to calibrate it by tilting the Microbit such that all of the LEDs light up.  It is a bit of a pain to do.


STEPS

STEP 1
Go to
https://makecode.microbit.org/ and create a new project named CompassAngle.

STEP 2
In the forever block, drag in a show string block (Basic menu). 

STEP 3
Inside the show string block, drag in a compass heading block (Input menu).

This block will get the compass angle from the Microbit.

STEP 4
Drag in a pause block (Basic menu) and set it to 2 seconds.



STEP 5 (TEST)
Download and run your program.  You will have to do the calibration activity by tilting the Microbit to fill the LED Matrix.  Then, your program should start. 

EXTRA

1. Try rotating your Microbit carefully to the values 0 (North), 90 (East), 180 (South) and 270 (West).

2. What angle would you need to point to the North-East?

3. Is the angle reading consistent or do you sometimes see strange values?

4. If you do not move the Microbit, does the angle value change?

separator-blank.png