Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:459c997f4e02
- Child:
- 1:6e1ddfeea3c6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Sep 04 03:12:52 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+Serial esp8266(D6, D7);//tx, rx
+DigitalOut led(D2);
+
+int main() {
+ while(1){
+ if (esp8266.readable()){
+ char val = esp8266.getc();
+ switch (val){
+ case 'a':
+ led = 1;
+ val=led.read();
+ esp8266.putc(led);
+ break;
+ case 'b':
+ led = 0;
+ val=led.read();
+ esp8266.putc(led);
+ break;
+ }
+ }
+ }
+}
+
\ No newline at end of file