Home › Forums › Forums › Technical Support for BerryIMU › AccZ angle trig check? › Reply To: AccZ angle trig check?
1)
Without “+P”, the values returned are from -180 to +180. 0 being horizontal (or level)
With “+P”, the values returned are from 0 to 360. 180 being horizontal (or level)
We wanted to use -180 to +180 for both X and Y. This is easy for the X axis, but the Y axis is orientated differently in the IMU, so we have to use Pi to get values between 0 and 360 and then we use other code just below the atan2 lines convert it to -180 to +180
2)
You cant calculate Z angle (or yaw) using accelerometer as the Z value never changes when spinning the IMU. To get this value, you would need to use the compass (magnetometer)
Mark --OzzMaker.com --
