svoe

Dependencies:   mbed mbed-STM32F103C8T6 MPU6050_1

Revision:
1:e2a6e523bf1f
Parent:
0:e9488589a8ee
Child:
2:f170902b3a15
--- a/wifi.h	Tue May 02 16:50:18 2017 +0000
+++ b/wifi.h	Sat May 06 18:21:55 2017 +0000
@@ -1,15 +1,13 @@
+void command_process(){
+    char tm_command = wifi.getc();
+    if (tm_command == 255) stop_flag = 1;
+    else{
+        if (tm_command < 128){speed = tm_command - 20;}
+        else {radius = tm_command - 128 - 20;}
+        stop_flag = 0; infinite_flag = 1;
+        }
+    }
+
 void wifi_init(){
-    wifi.printf("AT+CWMODE=3\r\n");
-    wait(0.1);
-    wifi.printf("AT+RST\r\n");
-    wait(0.1);
-    wifi.printf("AT+CWJAP_DEF=%s\r\n%s\r\n", "SN","3141592653589");
-    /*wait(0.1);
-    wifi.printf("AT+CIPSTART=%s\r\n%s\r\n%s\r\n", "TCP", "192.168.1.101", "2000");
-    wait(0.1);
-    wifi.printf("AT+CIPMODE=1\r\n");
-    wait(0.1);
-    wifi.printf("AT+CIPSEND\r\n");
-    wait(0.1);*/
-    }
-    
\ No newline at end of file
+    wifi.attach(&command_process);
+    } 
\ No newline at end of file