First of all, what is this measure unit?
It's in g
g
How can I get degrees?
I believe this should work:
var a = Microbit.accel(); print(Math.atan2(a.x, a.y)*180/Math.PI)
And....is there a way to get X, Y and Z separately?
As above you can save to a variable and access each field separately, or even Microbit.accel().x will work
Microbit.accel().x
@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.
It's in
g
I believe this should work:
As above you can save to a variable and access each field separately, or even
Microbit.accel().x
will work