Kevin Rhyne / Whiffy

Dependencies:   4DGL-uLCD-SE mbed

Revision:
18:94536dca963c
Parent:
17:4d0e180cde20
--- a/src/WifiControl.cpp	Tue Oct 20 12:38:02 2015 +0000
+++ b/src/WifiControl.cpp	Wed Oct 21 19:08:18 2015 +0000
@@ -6,6 +6,8 @@
     
     
     DigitalOut reset(p26);
+    AnalogIn configSwitch(p15);
+    
     reset=0; //hardware reset for 8266
     pc.baud(115200);  // set what you want here depending on your terminal program speed
     pc.printf("\f\n\r-------------ESP8266 Hardware Reset-------------\n\r");
@@ -20,28 +22,21 @@
  
     //ESPconfig();        //******************  include Config to set the ESP8266 configuration  ***********************
 
+    
+
+    if ( configSwitch > 0.5f ) {
+        pc.printf("CONFIG SWITCH THROWN");
+        ESPconfig();
+    }
+    
+    
     strcpy(snd,"AT+RST\r\n");
     SendCMD();
-    wait(2);
+    wait(3);
+
+
     
-    pc.printf("\n---------- Setting Mode ----------\r\n");
-    strcpy(snd, "AT+CWMODE=1\r\n");
-    SendCMD();
-    timeout=4;
-    getreply();
- 
-    wait(2);
- 
-    // set CIPMUX to 0=Single,1=Multi
-    pc.printf("\n---------- Setting Connection Mode ----------\r\n");
-    strcpy(snd, "AT+CIPMUX=1\r\n");
-    SendCMD();
-    timeout=4;
-    getreply();
- 
-    wait(2);
     
-    //ESPconfig();