Programming a pedometer using a Micro:bit
A pedometer is a device that measures the number of steps taken by a person while walking or running. These devices are in high demand in the modern world as many people monitor their daily physical activities with electronic devices. These observations help them manage their calorie intake. In a Micro:bit, we have an accelerometer to monitor various physical motions.
The concept of measuring the number of steps taken by the user is based on the physical motion detected by the Micro:bit. We can attach the Micro:bit to the foot or shoe of the user. A battery pack is attached to the Micro:bit. The Micro:bit will detect the shake movement whenever a person takes their next step. For every such movement that’s detected, we can increase the count of the number of steps taken. Their current step count is displayed on the LED matrix. We can reset the count to 0 by pressing button A. Figure 15.1 shows a Micro:bit attached to a shoe, which...