mpu6050内で指定されていたIDを 0x69から0x68へ変更した。

Files at this revision

API Documentation at this revision

Comitter:
Joeatsumi
Date:
Sat Feb 23 06:18:54 2019 +0000
Parent:
2:5c63e20c50f3
Commit message:
I changed the indicated sensor ID 69 to 68.

Changed in this revision

MPU6050.cpp Show annotated file Show diff for this revision Revisions of this file
MPU6050.h Show annotated file Show diff for this revision Revisions of this file
--- a/MPU6050.cpp	Mon Sep 10 21:26:25 2012 +0000
+++ b/MPU6050.cpp	Sat Feb 23 06:18:54 2019 +0000
@@ -6,9 +6,12 @@
 MPU6050::MPU6050(PinName sda, PinName scl) : connection(sda, scl) {
     this->setSleepMode(false);
     
+    //connection
+    connection.frequency( 400 * 1000 ); // SCL周波数を400kHzに変更
     //Initializations:
     currentGyroRange = 0;
     currentAcceleroRange=0;
+    
 }
 
 //--------------------------------------------------
@@ -207,7 +210,7 @@
         data[2]=(float)temp[2] / 3752.9;
         }
     if (currentGyroRange == MPU6050_GYRO_RANGE_1000){
-        data[0]=(float)temp[0] / 1879.3;;
+        data[0]=(float)temp[0] / 1879.3;
         data[1]=(float)temp[1] / 1879.3;
         data[2]=(float)temp[2] / 1879.3;
         }
@@ -215,6 +218,7 @@
         data[0]=(float)temp[0] / 939.7;
         data[1]=(float)temp[1] / 939.7;
         data[2]=(float)temp[2] / 939.7;
+        
         }
 }
 //--------------------------------------------------
--- a/MPU6050.h	Mon Sep 10 21:26:25 2012 +0000
+++ b/MPU6050.h	Sat Feb 23 06:18:54 2019 +0000
@@ -16,7 +16,7 @@
  * Defines
  */
 #ifndef MPU6050_ADDRESS
-    #define MPU6050_ADDRESS             0x69 // address pin low (GND), default for InvenSense evaluation board
+    #define MPU6050_ADDRESS             0x68 // address pin low (GND), default for InvenSense evaluation board
 #endif
 
 #ifdef MPU6050_ES