O'Reilly logo

Beginning BBC micro:bit: A Practical Introduction to micro:bit Development by Pradeeka Seneviratne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© 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 Seneviratne
(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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required