One of the more fun, active, and interesting things that you can do with your micro:bit is to turn it into a step counter. These things are so popular in today’s world; a phenomenon starting with the Fitbit device. Now, you’ll find that counting steps is just one feature of a watch or smartphone that you own.
Making your own using the micro:bit is a pretty easy task and is one of the activities that you’ll find at the project page of the makecode resource. Or, another resource that goes a bit further in Python here.
While a lot of things can be created and run in the editor at the site, this activity is one that you’ll want a real physical micro:bit to play around with and to test.
The key to all this working is an example of another way of having the micro:bit accept input. You’re not going to use either the A or B button here but rely on the fact that the micro:bit can detect when it’s shaken. The assumption here is that each step will generate a “shake”.
I found that it worked nicely. Accuracy isn’t necessarily the goal here; it’s to get the excitement from seeing the activity in action.
In order to fully test it, you’ll need to attach the battery pack (and batteries $$) to the micro:bit so that, once you’ve loaded your code, it will work without being attached to your computer.
I took mine and tucked the micro:bit and the battery pack inside my sock and then took it for a walk. I did so some counting and it did display a count after I stopped and removed it. Unlike my watch, it’s a little more different to get an ongoing count while actually walking! I need transparent socks.
For your morning smile, I will admit that it did feel a little like being under house arrest and having to wear an ankle bracelet. (not that I’d really know) But, with the exercise complete, there really was a bit of a Wow! factor. You really can do some pretty sophisticated programming with this thing.
I think back to my original post for this series of posts about the micro:bit. Could I have done this in an hour when I first started to program? Absolutely not. Even the concept of the step counter would have been foreign at the time. But, in today’s world, what a wonderful introduction to the concept of real-world application programming for students!