Try it with code

Try the code

Below is a simulation of the end result of this tutorial. Click on accelerometer and then shake to stoke the fire back into life:

If you want to try the code on your micro:bit, click on download hex and save the file onto your micro:bit when you’ve got it plugged in to your computer. You can see (and tweak or improve) the code for this sample by clicking on the {+} button on the bottom right.

The next page starts explaining how you can write and understand the python code that makes this work.