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

Branch:
DistanceRegulation
Revision:
30:4d1b3926a3cc
Parent:
27:5956d5e3ff63
--- a/hardware.h	Sat Jan 20 12:09:04 2018 +0000
+++ b/hardware.h	Sun Jan 21 17:58:41 2018 +0000
@@ -6,6 +6,7 @@
 #include "PID.h"
 #include "hcsr04.h"
 #include "ConfigFile.h"
+#include "ms5611.h"
 
 
 void loadConfigFile(void);
@@ -43,13 +44,19 @@
 float _P = 0;
 float _I = 0;
 float _D = 0;
-int _groundSetPoint = 0;
+float _groundSetPoint = 0;
 int _bias = 0;
 int _groundPidMinOutput = 0;
 int _groundPidMaxOutput = 0;
 bool _groundRegulation = false;
 
-
+// ms5611 - pressure senzor
+Thread *_altitudeThread;
+ms5611 ms(p9, p10, ms5611::CSBpin_0);
+Thread *_ms5611Thread;
+float _startAltitude = 0.0;
+float _setPointAltitude = 0.0;
+float _currentAltitude = 0.0;