SNE S1/S2 prime / Mbed OS NUCLEO_446RE_polling

Files at this revision

API Documentation at this revision

Comitter:
gr91
Date:
Thu Oct 29 16:45:27 2020 +0000
Child:
1:ed1145480f4b
Commit message:
BLinky

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json 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	Thu Oct 29 16:45:27 2020 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+//
+// test   led rouge et joystick DOWN et affichage sur terminal 
+// GR 2020
+// Universite Paris-Saclay - IUT Cachan
+//
+//
+#define TEMPO1 0.5
+#define TEMPO2 0.1
+Serial pc(USBTX, USBRX);
+DigitalOut ledr(PB_4);  //LED_red
+DigitalIn DOWN(PB_0);  //joystick down
+
+int main()
+{
+    float t;
+    pc.printf("LED clignotante deux vitesse \r\n");
+    ledr=1;
+    while(1) {
+        if(DOWN) t=TEMPO2;
+        else t=TEMPO1;
+        ledr = 0; // OFF
+        wait(t);
+        ledr = 1; // ON
+        wait(t);
+        pc.printf("periode %3.1f \r\n", 2*t);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Oct 29 16:45:27 2020 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#8ef0a435b2356f8159dea8e427b2935d177309f8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Thu Oct 29 16:45:27 2020 +0000
@@ -0,0 +1,7 @@
+{
+    "requires": ["bare-metal"],
+    "target_overrides": {
+      "*": {     
+      }
+    }
+}
\ No newline at end of file