Code the Micro:bit to React to Being Shaken

Use code to get the micro:bit to change from a happy face to a shocked face when it's shaken.

Step 1

The accelerometer can understand different gestures (like tilting or shaking the micro:bit).

Create an app that displays a happy face on the micro:bit and turns into a shocked face when the micro:bit is shaken.

Hint: click on the picture to see some blocks that might be useful

Step 2

Test your solution on the simulator, then download your code onto the micro:bit and try it out for real.