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:
21:0afb91824792
Parent:
15:9cdf757269fb
Child:
23:46ae5b0464da
diff -r 9ceec179b140 -r 0afb91824792 ESP8266/Server.h
--- a/ESP8266/Server.h	Sun Oct 29 11:27:27 2017 +0000
+++ b/ESP8266/Server.h	Sun Oct 29 11:56:04 2017 +0000
@@ -114,6 +114,14 @@
         strcat(webbuff, "<p><input type=\"radio\" name=\"led1\" value=\"0\" >  LED 1 off");
         strcat(webbuff, "<br><input type=\"radio\" name=\"led1\" value=\"1\" checked>  LED 1 on<br>");
     }
+    // ground regulation
+    if(_groundRegulation) {
+        strcat(webbuff, "<p><input type=\"radio\" name=\"groundRegulation\" value=\"1\" checked>  Ground regulation ON");
+        strcat(webbuff, "<br><input type=\"radio\" name=\"groundRegulation\" value=\"0\" >  Ground regulation OFF<br>");
+    } else {
+        strcat(webbuff, "<p><input type=\"radio\" name=\"groundRegulation\" value=\"1\" >  Ground regulation ON");
+        strcat(webbuff, "<br><input type=\"radio\" name=\"groundRegulation\" value=\"0\" checked>  round regulation OFF<br>");
+    }
     strcat(webbuff, "P: <input type=\"text\" name=\"proportional\" size=6 value=\"");
     ConvertToCharArray(_P);
     strcat(webbuff, _str);
@@ -152,7 +160,6 @@
     SendWEB();  // send web page
     memset(webbuff, '\0', sizeof(webbuff));
     sendcheck();
-
    
 }
 
@@ -222,6 +229,12 @@
         if (strstr(webdata, "led1=0") != NULL ) {
             led1=0;
         }
+        //ground regulation
+        if (strstr(webdata, "groundRegulation=1") != NULL )
+            _groundRegulation = true;
+        if (strstr(webdata, "groundRegulation=0") != NULL )
+            _groundRegulation = false;
+        // PID values
         if (strstr(webdata, "proportional") != NULL ){
             pc.printf("\n\r looking for data \n\r");
             char* p_webdata = strstr(webdata, "proportional");