Acceleration in meter per second square

Fork of MPU6050 by Baser Kandehir

Revision:
7:c9f95ebeb780
Parent:
6:5b90f2b5e6d9
Child:
8:0e3519559bcb
--- a/MPU6050.cpp	Wed Aug 05 13:15:07 2015 +0000
+++ b/MPU6050.cpp	Sat May 14 05:32:28 2016 +0000
@@ -34,7 +34,7 @@
 //I2C i2c(p9,p10);         // setup i2c (SDA,SCL)  
 
 /* For NUCLEO-F411RE board */
-static I2C i2c(D14,D15);         // setup i2c (SDA,SCL)
+static I2C i2c(PTE25,PTE24);         // setup i2c (SDA,SCL)
 
 /* Set initial input parameters */
 
@@ -138,21 +138,19 @@
         dest[i]=data[i];
 }
 
-// Communication test: WHO_AM_I register reading 
-void MPU6050::whoAmI()
+// Communication test: CHECKADDRESS register reading 
+void MPU6050::checkaddress()
 {
-    uint8_t whoAmI = readByte(MPU6050_ADDRESS, WHO_AM_I_MPU6050);   // Should return 0x68
-    pc.printf("I AM 0x%x \r\n",whoAmI);
+    uint8_t checkaddress = readByte(MPU6050_ADDRESS, CHECKADDRESS_MPU6050);   // Should return 0x68
+    pc.printf("I AM 0x%x \r\n",checkaddress);
     
-    if(whoAmI==0x68)
+    if(checkaddress==0x68)
     {
-        pc.printf("MPU6050 is online... \r\n");  
-        led2=1;
+        pc.printf("MPU6050 is connected... \r\n");  
     }
     else
     {
-        pc.printf("Could not connect to MPU6050 \r\nCheck the connections... \r\n");  
-        toggler1.attach(&toggle_led1,0.1);     // toggles led1 every 100 ms
+        pc.printf("No connection to MPU6050 !! Check the connections... \r\n");  
     }  
 }