![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
I2C通信を使用した角速度測定、LCD表示サンプル
Dependencies: mbed mbed_mpu6050_i2c_raw_register AQM0802
Diff: mpu6050.h
- Revision:
- 1:6f743fe9a027
- Parent:
- 0:abd3a0fd55a9
diff -r abd3a0fd55a9 -r 6f743fe9a027 mpu6050.h --- 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