We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 071f22b commit 66f4850Copy full SHA for 66f4850
GY521.cpp
@@ -97,11 +97,14 @@ void GY521::calibrate(uint16_t times)
97
_gze -= getGyroZ();
98
}
99
100
- // adjust calibration errors so read() should get all zero's on average.
101
- float factor = 1.0 / times;
+ // scale accelerometer calibration errors so read() should get all zero's on average.
+ float factor = _raw2g / times;
102
axe = _axe * factor;
103
aye = _aye * factor;
104
aze = _aze * factor;
105
+
106
+ // scale gyro calibration errors so read() should get all zero's on average.
107
+ factor = _raw2dps / times;
108
gxe = _gxe * factor;
109
gye = _gye * factor;
110
gze = _gze * factor;
0 commit comments