The micro:bit boasts a vast range of on-board functionality. I’m sure you will have noticed the buttons and the LED matrix but may not have come across the accelerometer as of yet. You will have used this in the previous lesson as it is the component used for the shake function which was used in the previous ‘roll a dice’ lesson.
The challenge is to use the accelerometer to control the LED matrix and move a dot around the screen.
This challenge will give you the basis of understanding of how to use the accelerometer as a control input.
Additional Challenge
Think about how what you have learned can be used to create a simple chase the dot game?
Learning Points
Use the x and y axis of the accelerometer to control the LED matrix
Utilising variables to store and display numbers
Use the plot function for the LED matrix
Use IF statements to distinguish between the variable outcomes
Understand how the accelerometer can be used as a control input
Block Editor Code
Click the button below to download the block editor code for this challenge. The hex file is contained in a zip folder.
Kindly refer here for instructions on importing code into Micro:bit.