Microbit accelerometer tutorial
In this tutorial we will be looking at how you can use the Microbit’s on-board accelerometer to control your Microbit, so that you can complete the challenges and use your learning when creating projects such as the Truth or Dare game or the radio controlled car.
What is an accelerometer?
An accelerometer is an electro-mechanical device that measures acceleration forces. These forces may be static, like the constant force of gravity pulling at your feet, or they could be dynamic. The are caused by moving or vibrating the accelerometer.
Source : dimension engineering
What are accelerometers used for?
- Detecting seismic activity ( detecting earthquakes, predicting eruptions)
- Ship autopilots
- Space shuttle navigation
- Drone stabilisation
- Camera anti-blur stabilisation
- Car airbag crash detection
How can we use the BBC Microbit accelerometer in our projects?
- Detecting shaking events
- Detecting acceleration events
- Detecting tilting
BBC Microbit shake sensor
The onShake function is triggered whenever the Microbit is shaken.
BBC Microbit tilt sensor (forward/backward)
Create a program that every time you shake the Microbit, it displays a smiley face!
Create a program that every time you shake the Microbit, it gives you a random piece of advice.
Create a program that tells you if your Microbit is tilting to the left or right
Create a program where the Microbit displays how far left or right it has been tilted by displaying a dot on the screen.
Create a program which displays an arrow indicating which direction the Microbit is tilting at that moment.
Create a program the uses a dot on the LED diplay matrix to indicate what direction the Microbit is tilting towards.