Most recent activity
-
-
Hi there!
I've also been experimenting with pedometer accuracy and would like to share my results.
I'm using several parameters - currently just as constants in the JS code:// Max step duration (ms) const cMaxTime = 1200; // Min step duration (ms) const cMinTime = 240; // Max difference between consecutive steps (%) const cMaxDiff = 50; // Min number of consecutive steps const cMinSteps = 5; // Step sensitivity as per http://forum.espruino.com/comments/15186837/ const cSensitivity = 400;
The trouble I'm running into is that getTime() seems to have a resolution of 80ms, which gives me trouble with really quick steps. When two steps are only 200ms apart, the jitter will often exceed the 50% set in cMaxDiff. Since I'm not a terriffic runner, that is not a problem for me, but for some it might be.
Maybe you would like to look into my code and use the best from both our attempts.
Thanks a lot!
I can't find a fault in my code. Could it be that Bangle.on('step') fires only at multiples of 80ms?
...
If I may answer my own question: Bangle.setPollInterval will improve resolution. I think the polling interval should be less or equal one-third of the minimum step duration. If the parameters were set in a menu, the polling interval could be adjusted accordingly.