jim hamblen
/
Serial_Bridge
Make a serial bridge from a serial I/O device on mbed to the PC
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 // Make a serial bridge from a serial I/O device on mbed to the PC 00003 Serial pc(USBTX, USBRX); // tx, rx 00004 Serial device(p13, p14); // tx, rx 00005 // Defaults to 9600 baud on each device - use .baud(baudrate) to change 00006 int main() { 00007 while(1) { 00008 if(pc.readable()) { 00009 device.putc(pc.getc()); 00010 } 00011 if(device.readable()) { 00012 pc.putc(device.getc()); 00013 } 00014 } 00015 } 00016
Generated on Thu Jul 14 2022 02:56:34 by 1.7.2