Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- pierreprovent
- Date:
- 2020-09-16
- Revision:
- 1:e3ae2ba0b532
- Parent:
- 0:918fdb31e2ce
File content as of revision 1:e3ae2ba0b532:
#include "mbed.h"
/*-----------------------------------------------------------------------
Before to use this example, ensure that you an hyperterminal installed on your computer. 
More info here: https://developer.mbed.org/handbook/Terminals
The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their definition in the PinNames.h file).
The default serial configuration in this case is 9600 bauds, 8-bit data, no parity. 
If you want to change the baudrate for example, you have to redeclare the
serial object in your code:
Serial pc(SERIAL_TX, SERIAL_RX);
Then, you can modify the baudrate and print like this:
pc.baud(115200);
pc.printf("Hello World !\n");
-------------------------------------------------------------------------*/
DigitalOut led(LED1);
int main()
{
    int i = 1;
    printf("Hello World !\n");
    while(1) {
        wait(1); // 1 second
        led = !led; // Toggle LED
        printf("This program runs since %d seconds.\n", i++);
    }
}