Paulo Loureiro de Sousa / Mbed 2 deprecated HelloWorld

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ploureiro
Date:
Wed Aug 03 13:13:44 2022 +0000
Commit message:
First commit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 03 13:13:44 2022 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+/*
+    This example shows the simplest thing you can do with an STM32 to see 
+    physical output: it blinks the on-board LED.
+    
+    use: screen /dev/ttyS0 115200 (Linux)
+    
+    You can detach from the screen session at any time by typing:
+
+    Ctrl+a d
+*/
+
+
+DigitalOut led(LED1);
+
+//interface série
+Serial pc(PA_2, PA_3, 115200);
+//Serial pc(SERIAL_TX, SERIAL_RX, 115200); // pc communication
+
+
+int main()
+{
+    while(1) {    
+        pc.printf("Hello \r\n");
+         
+        // printf("\nok\n");
+        led = 1;   // LED is ON
+        wait(5); // Wait 0.2 s 
+        led = 0;   // LED is OFF
+        wait(5); // Wait 0.2 s 
+        
+//        led = 1;   // LED is ON
+//        wait(2); // Wait 1 s
+ //       led = 0;   // LED is OFF
+ //       wait(2); // Wait 1 s
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Aug 03 13:13:44 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file