I have been messing with the internal compass function of the SensorExtended library. It returns directions in radians.
What code do I use to display this magnetic direction in degrees?
The demo program gives these values in radians:
N = 0
W = -90
S = 180 or -180
E = 90
I have tried this code:
degrees = radians * (180 / PI)
actual code is: NumberFormat(ORi(0),0,2) * (180 / PI) where ORi is the direction-radians returned by the sensor library.
But this doesn't return values in 360 degrees.
What code do I use to display this magnetic direction in degrees?
The demo program gives these values in radians:
N = 0
W = -90
S = 180 or -180
E = 90
I have tried this code:
degrees = radians * (180 / PI)
actual code is: NumberFormat(ORi(0),0,2) * (180 / PI) where ORi is the direction-radians returned by the sensor library.
But this doesn't return values in 360 degrees.