-
• #2
First of all, what is this measure unit?
It's in
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 -
• #3
Thanks Gordon!
I understand.
Hi everyone.
I'm trying to write a code that give the acceleration of X axis and, if it's major than 45° something happens.
Using
I have a string like this
First of all, what is this measure unit?
How can I get degrees?
And....is there a way to get X, Y and Z separately?
Thanks