Skip to content

Microbit Pedometer

Below is my code:

On start, it sets the value of steps to 0. On 3g, which I think is a measure of impact, changes the steps by 1. A shows you your step count, and B resets it. 

I put my microbit in my hand, as if it were a watch. This way, the swing of my arms would count my steps. 

The only modification I made to the original code was changing shake to 3g. 3g was more sensitive, and shake wasn't accurate enough because it wasn't very sensitive. 

I tested it by walking around my kitchen. I think that the accuracy was OK. I think it's the best of the different options they had for the accelerometer, though. 
Here is a picture of how I was holding it while I walked.

Anyway, to conclude this post, I think that it wasn’t too difficult of an assignment. It wasn’t as much trial and error as I thought it would be, and it was as accurate as I thought I could get it.

Here is a link to my code: https://makecode.microbit.org/#editor

Published inUncategorized

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to toolbar