How to Count the Number of Steps Using the Accelerometer

前端 未结 2 1415
暗喜
暗喜 2020-12-15 01:46

i want to know how to calculate steps taken using the Accelerometer. Actually i calculate acceleration and use this code to count step

length = sqrt(x * x +         


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-15 02:08

    Basically you're using sudden acceleration over a certain value as a sign that someone is ending or starting a step.

    First, you have to make sure you end up sampling the accelerometer frequently enough not to miss a step. Then you're going to have to make sure that you are guessing correctly about what your threshold should be.

    This is going to require a lot of trial and error.

    What I would recommend is graphing out what the length is over time and seeing if you can come up with a good threshold value that's usually correct.

    But, regardless, it's never really going to be accurate. I think the only way to really measure steps accurately is with a heel sensor in the shoe.

提交回复
热议问题