File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed
Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11//
22// FILE: GY521.cpp
33// AUTHOR: Rob Tillaart
4- // VERSION: 0.2.3
4+ // VERSION: 0.3.0
55// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
66// URL: https://github.com/RobTillaart/GY521
77//
1717// 0.2.2 2021-01-24 add interface part to readme.md
1818// add GY521_registers.h
1919// 0.2.3 2021-01-26 align version numbers (oops)
20- //
20+ // 0.3.0 2021-04-07 fix #18 acceleration error correction (kudo's to Merkxic)
2121
2222
2323#include " GY521.h"
@@ -107,16 +107,16 @@ int16_t GY521::read()
107107 _ay *= _raw2g;
108108 _az *= _raw2g;
109109
110+ // Error correct raw acceleration (in g) measurements // #18 kudos to Merkxic
111+ _ax += axe;
112+ _ay += aye;
113+ _az += aze;
114+
110115 // prepare for Pitch Roll Yaw
111116 _aax = atan (_ay / hypot (_ax, _az)) * RAD2DEGREES;
112117 _aay = atan (-1.0 * _ax / hypot (_ay, _az)) * RAD2DEGREES;
113118 _aaz = atan (_az / hypot (_ax, _ay)) * RAD2DEGREES;
114119
115- // Error correct the angles
116- _aax += axe;
117- _aay += aye;
118- _aaz += aze;
119-
120120 // Convert to Celsius
121121 _temperature = _temperature * 0.00294117647 + 36.53 ; // == /340.0 + 36.53;
122122
Original file line number Diff line number Diff line change 22//
33// FILE: GY521.h
44// AUTHOR: Rob Tillaart
5- // VERSION: 0.2.3
5+ // VERSION: 0.3.0
66// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
77// URL: https://github.com/RobTillaart/GY521
88//
1515#include " Wire.h"
1616
1717
18- #define GY521_LIB_VERSION (F(" 0.2.3 " ))
18+ #define GY521_LIB_VERSION (F(" 0.3.0 " ))
1919
2020
2121#ifndef GY521_THROTTLE_TIME
Original file line number Diff line number Diff line change 11//
22// FILE: GY521_registers.h
33// AUTHOR: Rob Tillaart
4- // VERSION: 0.2.3
4+ // VERSION: 0.3.0
55// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
66// URL: https://github.com/RobTillaart/GY521
77//
Original file line number Diff line number Diff line change 1515 "type" : " git" ,
1616 "url" : " https://github.com/RobTillaart/GY521.git"
1717 },
18- "version" :" 0.2.3 " ,
18+ "version" :" 0.3.0 " ,
1919 "frameworks" : " arduino" ,
2020 "platforms" : " *"
2121}
Original file line number Diff line number Diff line change 11name =GY521
2- version =0.2.3
2+ version =0.3.0
33author =Rob Tillaart <
[email protected] >
44maintainer =Rob Tillaart <
[email protected] >
55sentence =Arduino library for GY521 angle measurement
You can’t perform that action at this time.
0 commit comments