For bad/dodgy gyro/accel modules it is possible that all the readings (ax, ay and az) are all zeroes.
In that case calculateTilt() returns NaN.
*_az / (sqrt(_ax _ax + _ay _ay + _az _az))** --> division by 0.
The same possible issue with void setup() function, when USE_DMP defined - the same calculations copy-pasted there.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
For bad/dodgy gyro/accel modules it is possible that all the readings (ax, ay and az) are all zeroes. In that case calculateTilt() returns NaN. *_az / (sqrt(_ax _ax + _ay _ay + _az _az))** --> division by 0.
The same possible issue with void setup() function, when USE_DMP defined - the same calculations copy-pasted there.
iSpindel.cpp
float calculateTilt() { float _ax = ax; float _ay = ay; float _az = az; return acos(_az / (sqrt(_ax _ax + _ay _ay + _az _az))) 180.0 / M_PI; }
void setup() {
Serial.begin(115200);
.... ax = euler[0]; ay = euler[2]; az = euler[1];
}
endif
... }