ジャイロセンサを使用してLCDディスプレイに角速度情報を表示するプログラム

Dependencies:   mbed

Dependents:   line_trace_sample line_trace_sample_saitou line_trace_sample_tamada line_trace_ver2

Revision:
3:ebd656a9c89f
Parent:
1:6f743fe9a027
diff -r f2db52a742b0 -r ebd656a9c89f mpu6050.cpp
--- 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);