7. Case 05: Pedometer#

7.1. Purpose#


  • Use the Smart Coding Kit to create a wearable pedometer.

7.2. Materials#


  • 1 x smart coding kit

../../_images/smart_coding_kit_case_05_01.png

7.3. Software#


MicroSoftmakecode

7.4. Programming#


  • Show the preset icon while on start; Set i=i+1 while on shake and display the value of the variable i; set i as 0 while button A being pressed and display the value of i at the same time.

../../_images/smart_coding_kit_case_05_02.png

7.5. Result#


While detecting the shake, the displaying number will add up 1 automatically for each time being detected, and the value will be back to 0 once button A being pressed.

7.6. Exploration#


7.7. FAQ#


7.8. Relevant File#