Slightly different message and adds \r to the printf for terminal programs like screen /dev/ttyACM0 which don't add <CR> automatically.

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 //------------------------------------
00004 // Hyperterminal configuration
00005 // 9600 bauds, 8-bit data, no parity
00006 //------------------------------------
00007 
00008 Serial pc(SERIAL_TX, SERIAL_RX);
00009  
00010 DigitalOut myled(LED1);
00011  
00012 int main() {
00013   int i = 1;
00014   pc.printf("Hello World !\r\n");
00015   while(1) { 
00016       wait(1);
00017       pc.printf("This has been running for %d seconds.\r\n", i++);
00018       myled = !myled;
00019   }
00020 }
00021