© Pradeeka Seneviratne 2018
Pradeeka SeneviratneBeginning BBC micro:bithttps://doi.org/10.1007/978-1-4842-3360-3_5

5. Using the Accelerometer and Compass

Pradeeka Seneviratne1 
(1)
Mulleriyawa, Sri Lanka
 

The micro:bit board comes with built-in accelerometer and a compass that allows you to build applications that respond to the acceleration and magnetic field of the earth.

In this chapter, you learn how to take readings from the built-in accelerometer and compass (magnetometer) to build applications using MicroPython.

Accelerometer

The micro:bit has an on-board NXP/Freescale MMA8652 chip (see Figure 5-1), which is a three-axis accelerometer that can be used to measure the acceleration. The accelerometer is internally connected to the micro:bit’s I2C ...

Get Beginning BBC micro:bit: A Practical Introduction to micro:bit Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.