![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
I2C通信を使用した角速度測定、LCD表示サンプル
Dependencies: mbed mbed_mpu6050_i2c_raw_register AQM0802
Diff: mpu6050.cpp
- Revision:
- 3:ebd656a9c89f
- Parent:
- 1:6f743fe9a027
--- a/mpu6050.cpp Thu Dec 13 03:07:35 2018 +0000 +++ b/mpu6050.cpp Thu Dec 13 15:35:41 2018 +0000 @@ -14,7 +14,7 @@ 16.4, }; -MPU6050::MPU6050(PinName i2c_sda, PinName i2c_scl) : i2c(i2c_sda, i2c_scl), address(0x68 << 1), rate_accelemeter(16384.0), rate_gyroscope(131.0) +MPU6050::MPU6050(PinName i2c_sda, PinName i2c_scl) : i2c(i2c_sda, i2c_scl), address(0x68 << 1), rate_accelemeter(RATE_ACC_LIST[0]), rate_gyroscope(RATE_GYRO_LIST[0]) { setSleep(false); setMaxScale(MAX_ACC_2G, MAX_GYRO_250degpersec); @@ -55,7 +55,7 @@ short x, y, z; // read X h = readByte(0x3B); - l = readByte(0x75); + l = readByte(0x3C); x = h << 8 | l; // read Y h = readByte(0x3D);