#MonthOfMaking Day 7

#MonthOfMaking Day 7

March is all about MAKING!!

I have decided to take on the challenge of making a 5-minute micro:bit make every day throughout March.

Day07 – Spirit Level

Today I have decided to make a Spirit Level program. Great for checking that surfaces are level! Let’s get coding!

Python Code

from microbit import *
while True:
    reading = accelerometer.get_x()
    if reading > 20:
        display.show("R")
    elif reading < -20:
        display.show("L")
    else:
        display.show("-")

EduBlocks Code

EduBlocks code

MakeCode Code

MakeCode

Demo

Final Words

Come back Tomorrow for another fun 5-minute micro:bit make