kumaresh kj / Mbed 2 deprecated NucleoF103_SERIAL_UART_printf

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 // defau9600 bauds, 8-bit data, no parity
00006 
00007 //Arduino pin D0 & D1 is disconnected by default in nucleo board and hence serial O/P or I/P will not work.
00008 // REFER ST USER MANUAL UM 1724
00009 
00010 //O/P/ or I/P will work in ST link(USB to serial comm) or can also be used from CN3 connector of nucleo board. 
00011 //------------------------------------
00012 
00013 Serial pc(SERIAL_TX, SERIAL_RX);
00014  
00015 DigitalOut myled(LED1);
00016  
00017 int main() {
00018   int i = 1;
00019   pc.printf("Hello World !\n");
00020   while(1) { 
00021       wait(0.8);
00022       pc.printf("This program runs since %d seconds.\n", i++);
00023       myled = !myled;
00024   }
00025 }
00026