Marco Zecchini / Mbed 2 deprecated Esempio_helloworld

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 
00005 -- HelloWorld example
00006 
00007     Printing hello world and toggling LED1
00008     
00009 ------------------------------------------------------------------------------*/
00010 
00011 DigitalOut led(LED1);
00012 
00013 int main()
00014 {
00015     int i = 1;
00016 
00017     printf("Hello World !\n");
00018 
00019     while(1) {
00020         wait(1); // 1 second
00021         led = !led; // Toggle LED
00022         printf("This program runs since %d seconds.\n", i++);
00023     }
00024 }