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

Committer:
edy05
Date:
Thu Oct 26 15:54:47 2017 +0000
Revision:
2:d172c9963f87
Child:
8:b5128641d4cf
stable release with distanceRegulation thread

Who changed what in which revision?

UserRevisionLine numberNew contents of line
edy05 2:d172c9963f87 1 #ifndef HARDWARE
edy05 2:d172c9963f87 2 #define HARDWARE
edy05 2:d172c9963f87 3
edy05 2:d172c9963f87 4 #include "mbed.h"
edy05 2:d172c9963f87 5 #include "PpmRegen.h"
edy05 2:d172c9963f87 6 #include "PID.h"
edy05 2:d172c9963f87 7 #include "hcsr04.h"
edy05 2:d172c9963f87 8
edy05 2:d172c9963f87 9 Serial pc(USBTX, USBRX); // tx, rx
edy05 2:d172c9963f87 10
edy05 2:d172c9963f87 11 Thread serverThread;
edy05 2:d172c9963f87 12 Thread distanceThread;
edy05 2:d172c9963f87 13
edy05 2:d172c9963f87 14 InterruptIn* _interruptPort = new InterruptIn(p28);
edy05 2:d172c9963f87 15 PwmOut* _roll = new PwmOut(p21);
edy05 2:d172c9963f87 16 PwmOut* _pitch = new PwmOut(p22);
edy05 2:d172c9963f87 17 PwmOut* _throttle = new PwmOut(p23);
edy05 2:d172c9963f87 18 PwmOut* _yaw = new PwmOut(p24);
edy05 2:d172c9963f87 19 PwmOut* _aux1 = new PwmOut(p25);
edy05 2:d172c9963f87 20 PwmOut* _aux2 = new PwmOut(p26);
edy05 2:d172c9963f87 21 PpmRegen* _ppmRegen;
edy05 2:d172c9963f87 22
edy05 2:d172c9963f87 23 PID* _groundDistance;
edy05 2:d172c9963f87 24
edy05 2:d172c9963f87 25 HCSR04* _sonic;
edy05 2:d172c9963f87 26
edy05 2:d172c9963f87 27
edy05 2:d172c9963f87 28 #endif