#MonthOfMaking Day 4

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.

Day04 – Step Counter

Today I have decided to make a step counter.

Everytime the micro:bit is shaken it increases the number of steps by 1. Lets get coding!

Python Code

steps = None
from microbit import *
steps = 0
while True:
display.scroll(steps)
sleep(50)
if accelerometer. is_gesture('shake')
steps += 1

EduBlocks Code

EduBlocks code

MakeCode Code

MakeCode

Demo

Final Words

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

Series Navigation<< #MonthOfMaking Day 3#MonthOfMaking Day 5 >>

Leave a Reply