Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_WallbotBLE_Challenge2 by
Diff: main.cpp
- Revision:
- 3:f707552ec50a
- Parent:
- 2:3c406d25860e
- Child:
- 4:53eceb750885
diff -r 3c406d25860e -r f707552ec50a main.cpp
--- a/main.cpp	Fri Feb 20 00:07:48 2015 +0000
+++ b/main.cpp	Sun Jun 03 07:04:34 2018 +0000
@@ -2,10 +2,14 @@
 #include "BLEDevice.h"
 #include "RCBController.h"
 #include "TB6612.h"
+#include "MPU6050.h"
 
 #define DBG 0
 
 BLEDevice  ble;
+
+MPU6050 mpu(I2C_SDA, I2C_SCL);
+
 #if DBG
 Serial  pc(USBTX, USBRX);
 #endif
@@ -19,7 +23,7 @@
 AnalogIn fsen2(P0_3);
 AnalogIn fsen3(P0_4);
 AnalogIn fsen4(P0_5);
-#if 0
+#if 1
 TB6612 left(P0_29,P0_23,P0_24);
 TB6612 right(P0_28,P0_30,P0_0);
 #else
@@ -404,6 +408,11 @@
         }
     }
 
+    // MPU6050 Initialize
+    mpu.initialize();
+    mpu.setAcceleroRange(MPU6050_ACCELERO_RANGE_8G);
+    mpu.setGyroRange(MPU6050_GYRO_RANGE_1000);
+
     ble.init(); 
     ble.onConnection(onConnected);
     ble.onDisconnection(onDisconnected);
    