ok

Dependencies:   MPU6050 mbed

Files at this revision

API Documentation at this revision

Comitter:
fadi_lad
Date:
Thu Mar 09 17:00:25 2017 +0000
Parent:
1:59c9951b32db
Commit message:
Polynotes

Changed in this revision

MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MPU6050.lib	Fri Feb 17 07:48:45 2017 +0000
+++ b/MPU6050.lib	Thu Mar 09 17:00:25 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/fadi_lad/code/MPU6050/#0a077b7133e6
+https://developer.mbed.org/users/fadi_lad/code/MPU6050/#d477e0b6630a
--- a/main.cpp	Fri Feb 17 07:48:45 2017 +0000
+++ b/main.cpp	Thu Mar 09 17:00:25 2017 +0000
@@ -8,28 +8,30 @@
 
 //setting LED1 to give digital output
 DigitalOut myled(LED1);
+DigitalOut out(D0);
 
 //creating onject of MPU6050 class
 MPU6050 ark(PB_9,PB_8);
 
 int main()
 {
-    pc.baud (256000);
-    
+    pc.baud (270000);   
+    out=0;
+    ark.setAcceleroRange(MPU6050_ACCELERO_RANGE_8G);
+    ark.setGyroRange(MPU6050_GYRO_RANGE_2000);
     while(1) {
         //reading Temprature
         /*float temp = ark.getTemp();
         pc.printf("temprature = %0.2f ^C\r\n",temp); */   
         //reading Grometer readings
-        float gyro[3];
-        ark.getGyro(gyro);
-        
+        int gyro[3];   
+        ark.getGyro(gyro);   
         //reading Acclerometer readings
-        float acce[3];
+        int acce[3];
         ark.getAccelero(acce);
-        
-        pc.printf("U %f %f %f %f %f %f %f %f %f /",acce[0],acce[1],acce[2],gyro[0],gyro[1],gyro[2],acce[0],acce[1],acce[2]);
-
-        wait(0.01); //wait 1000ms
+        out=1;
+        pc.printf("U %d %d %d %d %d %d /",ark.getAcceleroRawX(),ark.getAcceleroRawY(),ark.getAcceleroRawZ(),ark.getGyroRawX(),ark.getGyroRawY(),ark.getGyroRawZ());
+        out=0;
+        //wait(0.01); //wait 1000ms
     }
 }