self-balancing-robot

Dependencies:   mbed mbed-rtos Motor

Revision:
13:8d8ac3189984
Parent:
12:1fc4b3d94397
Child:
14:f9c2cf6643cf
--- a/main.cpp	Sat Apr 18 21:30:26 2020 +0000
+++ b/main.cpp	Sat Apr 18 21:46:34 2020 +0000
@@ -1,6 +1,6 @@
 #include "mbed.h"
 #include "rtos.h"
-//#include "LSM9DS1.h"
+#include "LSM9DS1.h"
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -9,10 +9,11 @@
 Ticker bluetooth;
 Serial pc(USBTX, USBRX);
 
+
 Mutex parametersmutex;
 Serial blue(p28, p27);
 
-//LSM9D1 imu(p9, p10, 0xD6, 0x3C);
+LSM9DS1 imu(p9, p10, 0xD6, 0x3C);
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -133,8 +134,8 @@
 }
 
 void get_current_angle() {
-    return;
-//    imu.readGyro();
+//    return;
+    imu.readGyro();
 }
 
 
@@ -162,7 +163,7 @@
         parametersmutex.unlock();
         
         get_current_angle();
-//        pc.printf("gyro: %d %d %d\n\r", imu.gx, imu.gy, imu.gz);
+        pc.printf("gyro: %d %d %d\n\r", imu.gx, imu.gy, imu.gz);
         
         Thread::wait(100);
     }