This video shows how to write code to make the micro:bit into a compass using the compass sensor embedded on the micro:bit. It is an intermediate level coding activity. It utilized if/then statements, boolean operations, and creating and using a variable.
For more information on sensors, go to https://bit.ly/3WVOtFU . To view the accompanying blog post, go to https://bit.ly/3wIiEWv .
00:00 Introduction
01:19 Initializing the compass on the micro:bit
02:00 Create a variable in MakeCode
03:09 Build decision tree
10:00 Test the code using the simulator
10:30 Calibrate and test on micro:bit