Regenerating PPM signal based on distances from ultrasonic sensors, ESP8266 for connectin via wifi. Autonomous quadcopter behaviour, autonomou height holding. Flying direction based on front and back ultrasonic sensors.
Dependencies: ConfigFile HCSR04 PID PPM2 mbed-rtos mbed
Diff: main.cpp
- Branch:
- DistanceRegulation
- Revision:
- 33:a2f9fea05cb9
- Parent:
- 32:c729e6da7f9a
- Child:
- 34:5dca557e982f
--- a/main.cpp Sat Feb 17 15:48:49 2018 +0000 +++ b/main.cpp Sun Feb 18 17:10:48 2018 +0000 @@ -26,7 +26,7 @@ // INITIALIZE CLASSES _ppmRegen = new PpmRegen(_interruptPort); - _sonic = new HCSR04(p29, p30); + _sonic = new HCSR04(p5, p6); _groundDistance = new PID(0, 0, 0, 0.005); //setup PID @@ -42,10 +42,10 @@ _groundDistance->setBias(_bias); // STARTING THREADS - printf("starting server thread \n\r"); + pc.printf("starting server thread \n\r"); serverThread.start(serverRun); - serverThread.set_priority(osPriorityHigh); - printf("starting distance thread \n\r"); + serverThread.set_priority(osPriorityLow); + pc.printf("starting distance thread \n\r"); _distanceThread = new Thread(distanceRegulationThread); _distanceThread->set_priority(osPriorityRealtime); //distanceRegulation.start(2);