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 17:36:52 2017 +0000
Revision:
8:b5128641d4cf
Parent:
2:d172c9963f87
Child:
9:86a5af9935b1
ConfigFile tested reading and writing. Its ok.

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 8:b5128641d4cf 8 #include "ConfigFile.h"
edy05 2:d172c9963f87 9
edy05 2:d172c9963f87 10 Serial pc(USBTX, USBRX); // tx, rx
edy05 2:d172c9963f87 11
edy05 2:d172c9963f87 12 Thread serverThread;
edy05 2:d172c9963f87 13 Thread distanceThread;
edy05 2:d172c9963f87 14
edy05 2:d172c9963f87 15 InterruptIn* _interruptPort = new InterruptIn(p28);
edy05 2:d172c9963f87 16 PwmOut* _roll = new PwmOut(p21);
edy05 2:d172c9963f87 17 PwmOut* _pitch = new PwmOut(p22);
edy05 2:d172c9963f87 18 PwmOut* _throttle = new PwmOut(p23);
edy05 2:d172c9963f87 19 PwmOut* _yaw = new PwmOut(p24);
edy05 2:d172c9963f87 20 PwmOut* _aux1 = new PwmOut(p25);
edy05 2:d172c9963f87 21 PwmOut* _aux2 = new PwmOut(p26);
edy05 2:d172c9963f87 22 PpmRegen* _ppmRegen;
edy05 2:d172c9963f87 23
edy05 2:d172c9963f87 24 PID* _groundDistance;
edy05 2:d172c9963f87 25
edy05 2:d172c9963f87 26 HCSR04* _sonic;
edy05 2:d172c9963f87 27
edy05 2:d172c9963f87 28
edy05 8:b5128641d4cf 29
edy05 8:b5128641d4cf 30
edy05 8:b5128641d4cf 31
edy05 2:d172c9963f87 32 #endif