pc serial to wi-fi uart bridge

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut myled(LED1);
00004 Serial pc(USBTX, USBRX);
00005 Serial gs(p13, p14);
00006 DigitalOut rts(P0_22);
00007 
00008 int main() {
00009     myled = 1;
00010 
00011     pc.baud(115200);
00012     gs.baud(9600);
00013     rts = 0;
00014 
00015     for (;;) {
00016         if (pc.readable()) {
00017             gs.putc(pc.getc());
00018         }
00019         if (gs.readable()) {
00020             pc.putc(gs.getc());
00021         }
00022     }
00023 }