ESE350 project, Spring 2016, University of Pennsylvania

Dependencies:   Adafruit9-DOf Receiver mbed-rtos mbed

Revision:
18:a00d6b065c6b
Parent:
17:96d0c72e413e
Child:
19:39c144ca2a2f
--- a/main.cpp	Thu Apr 07 22:13:17 2016 +0000
+++ b/main.cpp	Fri Apr 08 23:08:32 2016 +0000
@@ -20,6 +20,13 @@
 {
     while(true) {
         myQuadcopter.controller();
+        motors motorsPwm=myQuadcopter.getPwm();
+
+        motor_2=motorsPwm.m2;
+        motor_4=motorsPwm.m4;
+        
+        //pc.printf("m1: %f m2: %f \n\r",  motorsPwm.m2, motorsPwm.m4);
+
         Thread::wait(10);
     }
 }
@@ -28,7 +35,7 @@
 {
     while(true) {
         myQuadcopter.readRc();
-        // Thread::wait(500);  // wait for some number of miliseconds
+        Thread::wait(50);  // wait for some number of miliseconds
     }
 }
 
@@ -71,22 +78,22 @@
 
     //check if remote controll is working with if statement
 
-    //Thread threadC(controller_thread);
+Thread threadC(controller_thread);
     pc.printf("Entering control loop\n\r");
 
     while (1) {
         myQuadcopter.readSensorValues();
-        pc.printf("%lld: %f,%f,%f,%f\r\n", myQuadcopter.id, myQuadcopter.thrust, myQuadcopter.yaw, myQuadcopter.pitch, myQuadcopter.roll);
+        //pc.printf("%lld: %f,%f,%f,%f\r\n", myQuadcopter.id, myQuadcopter.thrust, myQuadcopter.yaw, myQuadcopter.pitch, myQuadcopter.roll);
 
         // myQuadcopter.controller();
 
         // wait(0.01);
 
         // Set duty cycle
-        motors motorsPwm=myQuadcopter.getPwm();
+       // motors motorsPwm=myQuadcopter.getPwm();
 
-        motor_2=motorsPwm.m2;
-        motor_4=motorsPwm.m4;
+        //motor_2=motorsPwm.m2;
+        //motor_4=motorsPwm.m4;
 
         //pc.printf("F: %f M_x: %f M_y: %f M_z: %f\n\r",  F, M_x, M_y, M_z);
         // pc.printf("m1: %f m2: %f \n\r",  motorsPwm.m2, motorsPwm.m4);