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 SerialPassthrough by
main.cpp
00001 #include "mbed.h" 00002 00003 RawSerial pc(USBTX, USBRX); // computer to mbed board 00004 RawSerial esp(D1, D0); // mbed board to target board 00005 00006 int 00007 main() 00008 { 00009 pc.baud(115200); 00010 esp.baud(115200); 00011 wait(0.1); 00012 pc.printf("\r\n########### ready ###########\r\n"); 00013 esp.printf("AT+RST\r\n"); 00014 while(1) { 00015 if(pc.readable()) { 00016 char c = pc.getc(); 00017 //pc.putc(c); // echo character back to computer for sanity 00018 esp.putc(c); 00019 } 00020 if(esp.readable()) { 00021 char c = esp.getc(); 00022 pc.putc(c); 00023 } 00024 } 00025 }
Generated on Mon Jul 18 2022 10:19:39 by
1.7.2
