printf to UART

Dependencies:   mbed

main.cpp

Committer:
rakeshravula
Date:
2018-06-17
Revision:
1:76207e762bb4
Parent:
0:4a2f7ded5c1d

File content as of revision 1:76207e762bb4:

#include "mbed.h"
 
//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------
 
Serial pc(PC_6, PC_7);
 
DigitalOut myled(PD_14);
 
int main()
{
    int i = 1;
    pc.printf("Hello World !\n");
    while(1) {
        wait(1);
        printf("This program runs since %d seconds.\n", i++);
        myled = !myled;
    }
}