sa

Files at this revision

API Documentation at this revision

Comitter:
suads
Date:
Thu Nov 22 17:46:45 2018 +0000
Parent:
3:3c0727618a3b
Commit message:
seismo

Changed in this revision

I2Cdev.cpp Show annotated file Show diff for this revision Revisions of this file
I2Cdev.h Show annotated file Show diff for this revision Revisions of this file
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/I2Cdev.cpp	Wed Aug 23 17:25:27 2017 +0000
+++ b/I2Cdev.cpp	Thu Nov 22 17:46:45 2018 +0000
@@ -7,7 +7,7 @@
 
 #define useDebugSerial
 
-I2Cdev::I2Cdev(): i2c(p26,p27)
+    I2Cdev::I2Cdev(): i2c(p26,p27)//PB9,PB8   //D14,D15
 {
 
 }
--- a/I2Cdev.h	Wed Aug 23 17:25:27 2017 +0000
+++ b/I2Cdev.h	Thu Nov 22 17:46:45 2018 +0000
@@ -9,8 +9,8 @@
 
 #include "mbed.h"
 
-#define I2C_SDA p26
-#define I2C_SCL p27
+#define I2C_SDA PB_9 //PB_9
+#define I2C_SCL PB_8//PB_8
 //extern Serial pc; 
 class I2Cdev {
     private:
--- a/MPU6050.cpp	Wed Aug 23 17:25:27 2017 +0000
+++ b/MPU6050.cpp	Thu Nov 22 17:46:45 2018 +0000
@@ -68,7 +68,7 @@
 
 float ax,ay,az;
 float gx,gy,gz; 
-//#define useDebugSerial
+#define useDebugSerial 0
 
 //instead of using pgmspace.h
 typedef const unsigned char prog_uchar;
@@ -105,7 +105,7 @@
 {
 
 #ifdef useDebugSerial
-    debugSerial.printf("MPU6050::initialize start\n");
+  //  debugSerial.printf("MPU6050::initialize start\n");
 #endif
     //i2Cdev.frequency(400000);                      // fast i2c: 400 kHz
   
@@ -145,7 +145,7 @@
     
 
 #ifdef useDebugSerial
-    debugSerial.printf("MPU6050::initialize end\n");
+    //debugSerial.printf("MPU6050::initialize end\n");
 #endif
 }
 
@@ -156,11 +156,12 @@
 bool MPU6050::testConnection()
 {
 #ifdef useDebugSerial
-    debugSerial.printf("MPU6050::testConnection start\n");
+    //debugSerial.printf("MPU6050::testConnection start\n");
 #endif
     uint8_t deviceId = getDeviceID();
+    //debugSerial.printf("\n\n____%d___\n",deviceId);
 #ifdef useDebugSerial
-    debugSerial.printf("DeviceId = %d\n",deviceId);
+    //debugSerial.printf("DeviceId = %d\n",deviceId);
 #endif
     return deviceId == 0x34;
 }
--- a/MPU6050.h	Wed Aug 23 17:25:27 2017 +0000
+++ b/MPU6050.h	Thu Nov 22 17:46:45 2018 +0000
@@ -1,3 +1,4 @@
+
 //ported from arduino library: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
 //written by szymon gaertig (email: szymon@gaertig.com.pl)
 //