ESE350 project, Spring 2016, University of Pennsylvania

Dependencies:   Adafruit9-DOf Receiver mbed-rtos mbed

Revision:
23:04338a5ef404
Parent:
22:92401a4fec13
Child:
24:e220fbb70ded
--- a/main.cpp	Mon Apr 11 16:41:56 2016 +0000
+++ b/main.cpp	Tue Apr 12 22:54:16 2016 +0000
@@ -21,7 +21,7 @@
 void controller_thread(void const *args)
 {
     while(true) {
-        //myQuadcopter.readSensorValues();
+        myQuadcopter.readSensorValues();
 
         myQuadcopter.controller();
         motors motorsPwm=myQuadcopter.getPwm();
@@ -64,8 +64,6 @@
 
 int main()
 {
-    //Thread thread(controller_thread);
-
     // get desired values from joystick (to be implemented)
     // myQuadcopter.setDes(...)
 
@@ -74,11 +72,6 @@
     motor_3.period(0.01);          // motor requires a 2ms period
     motor_4.period(0.01);          // motor requires a 2ms period
 
-    //pc.printf("Pestingt.\n\r");
-
-
-
-
     // startup procedure
     pc.printf("Type 's' to start up Motors, or anything else to abort.\n\r");
     char a= pc.getc();
@@ -87,8 +80,6 @@
         return 0;
     };
 
-
-
     // Duty cycle at beginning must be  50%
     pc.printf("Starting up ESCs\n\r");
     motor_1 = 0.1;
@@ -103,8 +94,6 @@
         return 0;
     };
 
-
-
     /*     pc.printf("Outputting duty cycle specified below now press all but b to abort.\n\r");
              motor_1 = 0.07;
 
@@ -116,13 +105,10 @@
      };
      */
 
-
-    Thread threadR(rc_thread);
-    Thread battery(battery_thread);
+    Thread thread(controller_thread);
+    //Thread threadR(rc_thread);
+    //Thread battery(battery_thread);
 
-    //check if remote controll is working with if statement
-
-    Thread threadC(controller_thread);
     pc.printf("Entering control loop\n\r");
 
     while (1) {