Guide

3/7/2018 SparkFun Inventor's Kit for micro:bit Experiment Guide - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-microbit-experiment-guide/all#introduction-to-microsoft-makecode 59/63
Pulse Width Modulation
Introducing the Compass
(Magnetometer)
In the previous experiment you
learned about the accelerometer,
which measured gravity. The
compass, or technically the
magnetometer, measures a magnetic
field. Magnetic fields come in different
sizes, but the biggest is the one
produced by Earth itself, which is why
compasses work.