Mitsuo Mizuno / Mbed 2 deprecated frdm_scissors

Dependencies:   BufferedSerial mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "BufferedSerial.h"
00003 
00004 BufferedSerial pc(USBTX, USBRX);
00005 BufferedSerial uart3(PTC17, PTC16);
00006 
00007 int main() {
00008     pc.puts("\r\nscissors\r\n");
00009     
00010     uart3.baud(115200);
00011     uart3.format(8, Serial::None, 1>>1);
00012 
00013     while (true) {
00014         if (pc.readable()) {
00015             char c = pc.getc();
00016             uart3.putc(c);
00017         }
00018         while (uart3.readable()) {
00019             char d = uart3.getc();
00020             pc.putc(d);
00021         }
00022     }
00023 }