asdfsaf

Dependencies:   MPU6050-DMP-Ian mbed-rtos mbed

Revision:
0:dceb852b19f3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 27 09:23:23 2014 +0000
@@ -0,0 +1,44 @@
+/*
+    This code is in working condition.
+    DMP works in RTOS environment
+*/
+
+#include "mbed.h"
+#include "rtos.h"
+#include "robot.h"
+#include "MPU6050_6Axis_MotionApps20.h"
+#include "DMP.h"
+
+
+
+//int main() {
+void led2_thread(void const *args){
+    DigitalOut reset_pin(PTE5);
+    test_dmp();
+    MPU6050 mpu;
+   
+    myled = 0;   //turn on LED
+
+    btSwitch = 1;
+    bt.baud(baudRate);   //set baud rate for bluetooth device
+    
+    start_dmp(mpu);
+    
+    while(1){
+        //bt.baud(baudRate); 
+        //reset_pin = 0;
+        if(!mpuInterrupt && fifoCount < packetSize);    //interrupt not ready
+        else{   //mpu interrupt is ready
+            update_dmp(mpu);
+            mpuInterrupt = false;   //this resets the interrupt flag
+        }       
+    }
+}
+
+int main() {
+    Thread thread(led2_thread);
+    
+    while (true) {
+        Thread::wait(500);
+    }
+}
\ No newline at end of file