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

Dependencies:   mbed

Committer:
ChuckMcM
Date:
Sun Nov 16 06:46:27 2014 +0000
Revision:
2:a361a088704a
Parent:
1:e9d1c42a73ae
Adds \r to cover cases where auto CR is not enabled, syntax on the message to be a bit more readable.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:028fac66239d 1 #include "mbed.h"
bcostm 1:e9d1c42a73ae 2
bcostm 1:e9d1c42a73ae 3 //------------------------------------
bcostm 1:e9d1c42a73ae 4 // Hyperterminal configuration
bcostm 1:e9d1c42a73ae 5 // 9600 bauds, 8-bit data, no parity
bcostm 1:e9d1c42a73ae 6 //------------------------------------
bcostm 1:e9d1c42a73ae 7
bcostm 0:028fac66239d 8 Serial pc(SERIAL_TX, SERIAL_RX);
bcostm 0:028fac66239d 9
bcostm 0:028fac66239d 10 DigitalOut myled(LED1);
bcostm 0:028fac66239d 11
bcostm 0:028fac66239d 12 int main() {
bcostm 0:028fac66239d 13 int i = 1;
ChuckMcM 2:a361a088704a 14 pc.printf("Hello World !\r\n");
bcostm 0:028fac66239d 15 while(1) {
bcostm 0:028fac66239d 16 wait(1);
ChuckMcM 2:a361a088704a 17 pc.printf("This has been running for %d seconds.\r\n", i++);
bcostm 0:028fac66239d 18 myled = !myled;
bcostm 0:028fac66239d 19 }
bcostm 0:028fac66239d 20 }
bcostm 0:028fac66239d 21