Connect Wi-Fi

Dependencies:   mbed

Fork of Server-ESP8266 by Digital dog

Revision:
0:3c8c53e45689
Child:
1:c0fbff97b740
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 08 06:08:42 2017 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+ 
+Serial esp(D8, D2);
+Serial pc(D1, D0);
+
+void wifi() {
+    uint8_t data;
+    
+    while(1) {
+        if(esp.readable()) {
+            data = esp.getc();   
+            pc.printf("Data = %d \n",data);
+        }
+        else {
+            pc.printf("Error!! \n");
+        }
+        break;
+    }
+    
+}
+
+int main() {
+    pc.printf("Hello!! \n");
+    wifi();
+}
\ No newline at end of file