Test du terminal en entrée et en sortie. Commande d'une led au clavier.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gr91
Date:
Sun Jun 06 20:29:00 2021 +0000
Parent:
0:551a0996336c
Commit message:
xx;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 551a0996336c -r b5706302e178 main.cpp
--- a/main.cpp	Wed Jun 10 12:00:46 2020 +0000
+++ b/main.cpp	Sun Jun 06 20:29:00 2021 +0000
@@ -1,11 +1,12 @@
 #include "mbed.h"
 
-Serial pc(PA_2, PA_3);
-DigitalOut led(PA_15);
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalOut led(LED1);
 
 int main()
 {
-    pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");
+    
+    pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");  // Write terminal
     led=1;
     while(1) {
         char c = pc.getc(); // Read hyperterminal