Marcelo Salazar / Mbed OS passthrough
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003 RawSerial pc(USBTX, USBRX, 115200); // tx, rx
00004 RawSerial device(D1, D0, 115200);  // tx, rx
00005  
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 }