Comunicação entre o Nucleo e um módulo WiFi ESP8266.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
thiagofrosty
Date:
Thu Sep 14 02:36:05 2017 +0000
Commit message:
Comunica??o b?sica entre o N?cleo e o m?dulo ESP8266.;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 14 02:36:05 2017 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+
+#define  ESP8266_TX PD_5
+#define  ESP8266_RX PD_6
+
+Serial ESP8266(ESP8266_TX,ESP8266_RX,115200);
+
+DigitalOut myled(LED3);
+
+int main()
+{
+        ESP8266.printf("AT\r\n");
+        wait(1);
+        
+        ESP8266.printf("AT+SYSIOSETCFG=12,3,0\r\n");
+        wait(1);
+        
+        ESP8266.printf("GPIOAT+SYSGPIODIR=12,1\r\n");
+        wait(1);
+        
+        ESP8266.printf("AT+SYSGPIOWRITE=12,1\r\n");
+        wait(1);
+    
+    while(1) 
+    {
+        ESP8266.printf("AT+SYSGPIOWRITE=12,0\r\n");
+        wait(1);
+        
+        ESP8266.printf("AT+SYSGPIOWRITE=12,1\r\n");
+        wait(1);
+        
+        myled = !myled;
+    }
+}
+
+/*
+int main()
+{
+    while(1)
+    {
+        ESP8266.printf("AT\r\n");
+        wait(1);
+    }
+}
+*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 14 02:36:05 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec
\ No newline at end of file