Pierre Provent / Mbed 2 deprecated Test_UART_Nucleo_F429ZI

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 Before to use this example, ensure that you an hyperterminal installed on your computer. 
00005 More info here: https://developer.mbed.org/handbook/Terminals
00006 The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their definition in the PinNames.h file).
00007 The default serial configuration in this case is 9600 bauds, 8-bit data, no parity. 
00008 If you want to change the baudrate for example, you have to redeclare the
00009 serial object in your code:
00010 
00011 Serial pc(SERIAL_TX, SERIAL_RX);
00012 
00013 Then, you can modify the baudrate and print like this:
00014 
00015 pc.baud(115200);
00016 pc.printf("Hello World !\n");
00017 -------------------------------------------------------------------------*/
00018 
00019 DigitalOut led(LED1);
00020 
00021 int main()
00022 {
00023     int i = 1;
00024 
00025     printf("Hello World !\n");
00026 
00027     while(1) {
00028         wait(1); // 1 second
00029         led = !led; // Toggle LED
00030         printf("This program runs since %d seconds.\n", i++);
00031     }
00032 }