In this challenge we are going to code the MicroBit to track steps.
Using the OnShake command, the Micro:Bit can detect movement. First you will want to create a variable. I called my “steps”. You’ll see from the screenshot below that I increment “steps” by one every time the device detects movement. I also use A button input to reset and B button input to display the total number of steps at anytime.
To see it in action, check out the video below.