attempt at producing a working Software Serial UART. LIBRARY DOES NOT YET WORK COMPLETELY.

Dependencies:   mbed SoftwareSerial

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "SoftwareSerial.h"
00003 
00004 Serial pc(USBTX, USBRX);
00005 SoftwareSerial ss(p19, p20);
00006 
00007 
00008 int main() {
00009     pc.baud(115200);
00010     pc.putc('\f');
00011     pc.printf("==== MBED Serial Proxy ====\r\n");
00012     
00013     wait(2);
00014     ss.baud(300);
00015     wait(2);
00016     
00017     while(1) {
00018         if(pc.readable()) ss.putc(pc.getc());
00019         if(ss.readable()) pc.putc(ss.getc());
00020     }
00021 }
00022 
00023