Reply To: Berry IMU at 90

Home Forums Forums Technical Support for BerryIMU Berry IMU at 90 Reply To: Berry IMU at 90

#7571
Mark Williams
Keymaster

change this;
AccYangle = (float) (atan2(accRaw[2],accRaw[0])+M_PI)*RAD_TO_DEG;
to this
AccYangle = (float) (atan2(accRaw[1],-accRaw[0])+M_PI)*RAD_TO_DEG;

comment out these lines

//              if (AccYangle > 90)
//                              AccYangle -= (float)270;
//              else

and just leave;
AccYangle -= (float)90;

Mark --OzzMaker.com --

Blip, blop, bloop...