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.
Fork of Serial_2 by
main.cpp
00001 #include "mbed.h" 00002 00003 #define esp8266 pc 00004 DigitalOut led_extern(PB_15); 00005 DigitalOut led(LED1); 00006 //Serial pc(USBTX, USBRX); 00007 Serial esp8266(PB_6, PB_7); 00008 char val; 00009 int main() { 00010 pc.baud(115200); 00011 //esp8266(115200); 00012 while(1) { 00013 if(pc.readable()) { 00014 //pc.printf("Ready\n"); 00015 val = pc.getc(); 00016 if(val=='a'){ 00017 led = 1 ; 00018 led_extern = 1; 00019 //pc.printf("LED ON\n"); 00020 } 00021 else if (val == 'b') { 00022 led = 0; 00023 led_extern = 0; 00024 //pc.printf("LED OFF\n"); 00025 } 00026 } 00027 } 00028 }
Generated on Sun Jul 17 2022 07:21:52 by
1.7.2
