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:
40:0aa1cefe80ab
Parent:
39:93d8aa47f4ce
Child:
41:5fe200d20022
--- a/ESP8266/Server.h	Sun Mar 25 12:57:04 2018 +0000
+++ b/ESP8266/Server.h	Tue May 15 10:34:35 2018 +0000
@@ -53,6 +53,7 @@
         count++;
     }
     if(strlen(webbuff)>bufflen) {
+        //printf("bufflen %d \n\r");
         DataRX=1;
         led3=0;
     }
@@ -93,7 +94,7 @@
                     
             }
             else{
-                ////pc.printf("Page was not sent \n\r");    
+                pc.printf("Page was not sent \n\r");    
             }
             esp.attach(&callback);
             ////pc.printf(" IPD Data:\r\n\n Link ID = %d,\r\n IPD Header Length = %d \r\n IPD Type = %s\r\n", linkID, ipdLen, type);
@@ -238,7 +239,7 @@
         }
     }
     if(weberror==1) { // restart connection
-        //pc.printf("sendcheck - restarting connection \n\r");
+        pc.printf("sendcheck - restarting connection \n\r");
         strcpy(cmdbuff, "AT+CIPMUX=1\r\n");
         timeout=500;
         getcount=10;
@@ -433,17 +434,21 @@
             _goAhead = true;
         if (strstr(webdata, "goAhead=0") != NULL )
             _goAhead = false;
-        // pid min Output
+        
+        pc.printf("test \n\r");
         sprintf(channel, "%d",linkID);
         if (strstr(webdata, "GET") != NULL) {
+            pc.printf("GET \n\r");
             servreq=1;
         }
         if (strstr(webdata, "POST") != NULL) {
+            pc.printf("POST \n\r");
             servreq=1;
         }
         webcounter++;
         sprintf(webcount, "%d",webcounter);
     }else{
+        pc.printf("no + \n\r");
         memset(webbuff, '\0', sizeof(webbuff));
         esp.attach(&callback);
         weberror=1;