Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By iFire
#37874 I found the problem!
I trace the code and I found out that "atan" return "ovf" for values above than 0.43

For X axis MPU6050_6Axis_MotionApps20.h use this code to calculate roll:
Code: Select alldata[2] = atan(gravity -> y / sqrt(gravity -> x*gravity -> x + gravity -> z*gravity -> z));

everything work when I remove "atan" and use this code:
Code: Select alldata[2] =gravity -> y / sqrt(gravity -> x*gravity -> x + gravity -> z*gravity -> z);

Then I calculate "atan" with a calculator and there is no problem.

So "atan" and maybe "atan2" cause this problem.
Any solution?
User avatar
By picstart
#37884 I recall that there are issues with the arduino libm.a for the esp8266. The one included with arduinino 1.6.5 has size 2.14 mb and often generates math errors. The working one surprisingly is just 44.3 kb and doesn't generate math errors. If you have a defective libm.a then this could be the source of your issue and would explain why the non esp8266 code is working and the same code compiled for the esp8266 is not.