![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ESE350 project, Spring 2016, University of Pennsylvania
Dependencies: Adafruit9-DOf Receiver mbed-rtos mbed
Diff: main.cpp
- Revision:
- 31:d473eacfc271
- Parent:
- 30:4820042e67b5
- Child:
- 34:eaea0ae92dfa
diff -r 4820042e67b5 -r d473eacfc271 main.cpp --- a/main.cpp Wed Apr 20 02:29:37 2016 +0000 +++ b/main.cpp Thu Apr 21 20:57:19 2016 +0000 @@ -20,6 +20,8 @@ DigitalOut batteryLed(LED1); DigitalOut shutDownLed(LED2); +Timer timer; // timer ;) + int emergencyOff = 0; //int lowThrust= {0,0,0}; int nLowThrust = 0; @@ -63,7 +65,7 @@ myQuadcopter.readSensorValues(); - myQuadcopter.controller(); + myQuadcopter.controller(timer.read()); motors motorsPwm = myQuadcopter.getPwm(); motor_1 = motorsPwm.m1; @@ -131,6 +133,8 @@ motor_4 = 0.1; wait(3); // hold startup duty cycle for 2 seconds + + timer.start(); // TODO assign priorities to threads, test if it really works as we expect Thread battery(battery_thread);