Image

4MAGICAL MAGNETISM

As you saw in Chapter 1, the micro:bit has a built-in magnetometer that serves a variety of purposes. In this chapter, we’ll use it to turn your micro:bit into a compass that tells you which direction you’re facing. We’ll also measure the magnetic fields of neodymium magnets. Then, we’ll make a magnetic alarm that rings whenever someone opens the door.

PROJECT: COMPASS

Image

Difficulty: Easy

In this project, shown in Figure 4-1, you’ll use the micro:bit’s built-in magnetometer as a compass. It will display an arrow on the screen that ...

Get Micro:bit for Mad Scientists now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.