SERIAL BRIDGE
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 00002 #include "mbed.h" 00003 Serial device(PC_10,PC_11); 00004 Serial pc(USBTX,USBRX); 00005 00006 int main() 00007 { 00008 device.baud(9600); 00009 pc.baud(9600); 00010 00011 while(1) 00012 { 00013 00014 if(device.readable()) 00015 { 00016 pc.putc(device.getc()); 00017 } 00018 00019 if(pc.readable()) 00020 { 00021 device.putc(pc.getc()); 00022 } 00023 00024 } 00025 }
Generated on Wed Jul 27 2022 14:43:18 by
1.7.2