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:
33:a2f9fea05cb9
Parent:
32:c729e6da7f9a
Child:
34:5dca557e982f
--- a/ESP8266/Server.h	Sat Feb 17 15:48:49 2018 +0000
+++ b/ESP8266/Server.h	Sun Feb 18 17:10:48 2018 +0000
@@ -37,8 +37,8 @@
 void serverLoop();
 void callback();
 
-int port        =80;  // set server port
-int SERVtimeout =5;    // set server timeout in seconds in case link breaks.
+int port        = 80;  // set server port
+int SERVtimeout = 8;    // set server timeout in seconds in case link breaks.
 
 
 
@@ -211,8 +211,8 @@
 
 void sendcheck(){
     weberror=1;
-    timeout=500;
-    getcount=24;
+    timeout= 1000;
+    getcount = 50;
     t2.reset();
     t2.start();
     while(weberror==1 && t2.read() <5) {
@@ -229,6 +229,12 @@
         SendCMD();
         getreply();
         pc.printf(replybuff);
+        sprintf(cmdbuff,"AT+CIPSERVER=0,%d\r\n", port);
+        timeout=500;
+        getcount=10;
+        SendCMD();
+        getreply();
+        pc.printf(replybuff);
         sprintf(cmdbuff,"AT+CIPSERVER=1,%d\r\n", port);
         timeout=500;
         getcount=10;