Dersler / Mbed 2 deprecated Nucleo_Serial_Baud

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 Serial device(USBTX, USBRX);  // tx, rx
00004 int rd = 0;
00005 int main() {
00006     device.baud(115200);
00007     while(1){
00008     device.printf("Hello World\n");
00009     rd = device.readable();
00010     if(rd !=0)
00011     {
00012         device.putc(device.getc());
00013     }
00014     
00015     wait(1.0);
00016     }
00017 }