Posts

Showing posts from July, 2023

Microbit step counter

Image
In this blog post I made a step counter. I am planning to use this for a coding challenge in the place where I live. The purpose is to help people track how much moderate activity they do The solution uses a Micro:bit which is the same microcontroller for kids that I have used in other projects. This project uses the accelerometer to count your foot steps. The accelerometer is a type of sensor that detects movement. These are the movements you can detect with the accelerometer. My project uses "on shake" This is the code. I made a variable called "steps" that keeps track of how many steps have been detected. It gets increased by 2 every time it gets shaken because we have two legs. If button A is pressed it will set the "steps" to 0 and if you press button B it will show how many steps you have walked so far. In the following video you can how it works