Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: gy521.hpp
- Revision:
- 4:39ef4d91dc34
- Parent:
- 3:28c77df7c0b6
--- a/gy521.hpp Mon Jan 06 11:06:26 2020 +0000
+++ b/gy521.hpp Fri Jul 24 14:12:15 2020 +0000
@@ -15,6 +15,21 @@
//I2C i2c(SDA,SCL);
//GY521 gyro(i2c);
+enum GY521RegisterMap {
+ WHO_AM_I = 0x75,
+ PWR_MGMT_1 = 0x6B,
+ LPF = 0x1A,
+ FS_SEL = 0x1B,
+ AFS_SEL = 0x1C,
+ ACCEL_XOUT_H = 0x3B,
+ ACCEL_YOUT_H = 0x3D,
+ ACCEL_ZOUT_H = 0x3F,
+ //TEMPERATURE = 0x41,
+ //GYRO_XOUT_H = 0x43,
+ //GYRO_YOUT_H = 0x45,
+ GYRO_ZOUT_H = 0x47
+};
+
class GY521{
public:
GY521(I2C &i2c,int bit = 2,int calibration = 1000,double user_reg = 1.0);