Test du terminal en entrée (affichage, debug ...)

Dependencies:   mbed

Revision:
1:7f51926123a1
Parent:
0:551a0996336c
Child:
2:3f6417fe959d
--- a/main.cpp	Wed Jun 10 12:00:46 2020 +0000
+++ b/main.cpp	Sun Jun 06 20:17:29 2021 +0000
@@ -1,19 +1,14 @@
 #include "mbed.h"
 
-Serial pc(PA_2, PA_3);
-DigitalOut led(PA_15);
+Serial pc(SERIAL_TX, SERIAL_RX);
+
 
 int main()
 {
-    pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");
-    led=1;
+    int i=0;
+    pc.printf("Test eu terminal \n\r");  // Write terminal
     while(1) {
-        char c = pc.getc(); // Read hyperterminal
-        if (c == '0') {
-            led = 0; // OFF
-        }
-        if (c == '1') {
-            led = 1; // ON
-        }
+        pc.printf("compteur = %D \n\r",i++);  // Write terminal
+        wait(1);
     }
 }