satoshi shimada
/
mbed_mpu6050_i2c_raw_register
MPU-6050 sample code
Diff: mpu6050.h
- Revision:
- 1:6f743fe9a027
- Parent:
- 0:abd3a0fd55a9
--- a/mpu6050.h Wed Dec 12 12:42:30 2018 +0000 +++ b/mpu6050.h Thu Dec 13 03:00:27 2018 +0000 @@ -1,5 +1,8 @@ #include "mbed.h" +#ifndef MPU6050_H +#define MPU6050_H + enum { MAX_ACC_2G, MAX_ACC_4G, @@ -23,6 +26,7 @@ void readGyroscope(double &gyro_x, double &gyro_y, double &gyro_z); void setMaxScale(int max_acc, int max_gyro); void getMaxScale(int &acc, int &gyro); + void setSleep(bool sleep); private: I2C i2c; int address; @@ -31,3 +35,5 @@ char readByte(char reg); void writeByte(char reg, char data); }; + +#endif // MPU6050_H