Ahh - right. So a.mag is what you'd found above - it's sqrt(accMagSquared)/8192
a.mag
sqrt(accMagSquared)/8192
It should be 1/8192 accMag value in stepcount.c: https://github.com/espruino/Espruino/blob/fc2d816c57bd36da89972aa39775ba03c3d591a5/libs/misc/stepcount.c#L248
accMag
stepcount uses an integer square root but otherwise the value should be basically identical
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh - right. So
a.mag
is what you'd found above - it'ssqrt(accMagSquared)/8192
It should be 1/8192
accMag
value in stepcount.c: https://github.com/espruino/Espruino/blob/fc2d816c57bd36da89972aa39775ba03c3d591a5/libs/misc/stepcount.c#L248stepcount uses an integer square root but otherwise the value should be basically identical