Micro:Bit Compass DIY

by nerdsclub0 in Circuits > Gadgets

718 Views, 4 Favorites, 0 Comments

Micro:Bit Compass DIY

download.png

How to code a Micro:Bit compass.

Click this LINK or go to https://makecode.microbit.org/

Block Coding Part 1

screenshot-makecode-microbit-org-1606838302585.png

Copy the block layout above.

Block Coding Part 2

2020-12-01-11-18-makecode.microbit.org.png
2020-12-01-11-19-makecode.microbit.org.png
Headingv3.jpg

Add the code above to previous code in "forever" block. Use compass for reference (if unable to see compass headings).

Finishing Block Coding

2020-12-01-11-22-makecode.microbit.org.png
2020-12-01-11-22-makecode.microbit.org (1).png

Once finish your code should look like this. Test your code using the simulator.

Flashing Code to Micro:Bit

2020-12-01-11-27-makecode.microbit.org.png

Next plug in your Micro:Bit (via the include micro usb cable). Then find the download button and click the three dots on the right side. Click pair device and follow the provided instructions.

Have Fun!!!

Don't forget to calibrate your compass!