Franck DURAND / Mbed 2 deprecated Read_Button_Nucleo_F429ZI_Exercice1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
fdurand
Date:
Wed Nov 04 09:16:05 2020 +0000
Parent:
1:e470129442d8
Commit message:
Exemple Read_button

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Sep 16 08:49:28 2020 +0000
+++ b/main.cpp	Wed Nov 04 09:16:05 2020 +0000
@@ -1,3 +1,7 @@
+// Franck DURAND 2020
+// Cours 3 Exercice 1
+
+
 #include "mbed.h"
 
 DigitalIn mybutton(USER_BUTTON);
@@ -6,9 +10,10 @@
 int main()
 {
     while(1) {
-        if (mybutton == 0) { // Button is pressed
+        if (mybutton == 1) { // Button is pressed
             myled = !myled; // Toggle the LED state
             wait(0.2); // 200 ms
         }
     }
 }
+