Paulo Loureiro de Sousa / Mbed 2 deprecated 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     This example shows the simplest thing you can do with an STM32 to see 
00005     physical output: it blinks the on-board LED.
00006     
00007     use: screen /dev/ttyS0 115200 (Linux)
00008     
00009     You can detach from the screen session at any time by typing:
00010 
00011     Ctrl+a d
00012 */
00013 
00014 
00015 DigitalOut led(LED1);
00016 
00017 //interface série
00018 Serial pc(PA_2, PA_3, 115200);
00019 //Serial pc(SERIAL_TX, SERIAL_RX, 115200); // pc communication
00020 
00021 
00022 int main()
00023 {
00024     while(1) {    
00025         pc.printf("Hello \r\n");
00026          
00027         // printf("\nok\n");
00028         led = 1;   // LED is ON
00029         wait(5); // Wait 0.2 s 
00030         led = 0;   // LED is OFF
00031         wait(5); // Wait 0.2 s 
00032         
00033 //        led = 1;   // LED is ON
00034 //        wait(2); // Wait 1 s
00035  //       led = 0;   // LED is OFF
00036  //       wait(2); // Wait 1 s
00037 
00038     }
00039 }