Step 1: Make it
What is it?
Make a step counter with longer-lasting batteries.
How it works
- Like the Step counter project this program uses the accelerometer to count a step every time the micro:bit is shaken and stores the total number in a variable called steps.
- Keeping the LED lights on the micro:bit turned on requires more power. This program saves energy by only showing the step count when you press button A.
- This means that the batteries will last longer, saving money, creating less waste and helping the environment.
What you need
- micro:bit (or MakeCode simulator)
- MakeCode or Python editor
- battery pack (optional)
- something to attach the micro:bit to your shoe or leg – string, tape or Velcro.
Step 2: Code it
Step 3: Improve it
- Modify the program so button B sets the counter back to 0.
- Measure the length of your step and get micro:bit to multiply this by the number of steps to calculate the distance you’ve walked.
- Think of ways of adapting other projects to make the batteries last longer.