test pour buffer

Revision:
7:37ea12f2b18f
Parent:
6:a58f18b765cd
Child:
8:23fca4edc6b9
--- a/main.cpp	Fri Oct 23 19:24:05 2020 +0000
+++ b/main.cpp	Sun Oct 25 16:47:59 2020 +0000
@@ -1,25 +1,23 @@
 #include "mbed.h"
 //
-// test led et liaison serie
+// test led
 // GR 2020
 // Universite Paris-Saclay - IUT Cachan
 //
 //
-
+#define TEMPO 0.5
 Serial pc(USBTX, USBRX);
-DigitalOut led(LED1);
+DigitalOut led(PA_5);  //LED1
 
 int main()
 {
-    pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\r\n");
+    pc.printf("LED clignotante\r\n");
     led=1;
     while(1) {
-        char c = pc.getc(); // Read hyperterminal
-        if (c == '0') {
-            led = 0; // OFF
-        }
-        if (c == '1') {
-            led = 1; // ON
-        }
+        led = 0; // OFF
+        wait(TEMPO);
+        led = 1; // ON
+        wait(TEMPO);
     }
 }
+