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.
Diff: main.cpp
- Revision:
- 0:30590decb1a0
diff -r 000000000000 -r 30590decb1a0 main.cpp
--- /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
+
+ }
+}