Simple Spirit Level

Do you know what a spirit level is? It is a tool that tells you when something is level. It's a very useful tool to have if you ever make a shelf!

The important part of a spirit level is a little tube with coloured alcohol in it. There is a bubble of air in the alcohol. The tool is level when the bubble is in the middle of the tube.

We can use the microbit's accelerometer to turn the microbit into a spirit level. There are a lot of ways to do this and it can get a bit complicated. There is a really simple way. We use a block from the LED palette called 'plot bar graph of...'

We need to supply the maximum value that we will get from the accelerometer. This value is 1023.

The code is shown below.