Nucleo serial comm input output details

Dependencies:   mbed

main.cpp

Committer:
kumaresh
Date:
2015-04-20
Revision:
0:30ef5d9ef234

File content as of revision 0:30ef5d9ef234:

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// defau9600 bauds, 8-bit data, no parity

//Arduino pin D0 & D1 is disconnected by default in nucleo board and hence serial O/P or I/P will not work.
// REFER ST USER MANUAL UM 1724

//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. 
//------------------------------------

Serial pc(SERIAL_TX, SERIAL_RX);
 
DigitalOut myled(LED1);
 
int main() {
  int i = 1;
  pc.printf("Hello World !\n");
  while(1) { 
      wait(0.8);
      pc.printf("This program runs since %d seconds.\n", i++);
      myled = !myled;
  }
}