Mon Hdz / Mbed 2 deprecated Ejercicio2_practica3_copy

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
montse
Date:
Wed Apr 15 20:42:25 2020 +0000
Parent:
25:869f212440f8
Commit message:
Programa que enciende un led al presionar un boton

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Apr 11 10:52:53 2020 +0000
+++ b/main.cpp	Wed Apr 15 20:42:25 2020 +0000
@@ -10,9 +10,16 @@
 
 int main()
 {
-   while(boton1==1)
+   while(1)
    {
-        myled = 1; 
+       if (boton1.read()==0)
+       {
+           myled=1;
+       }
+       
+       else{
+           myled=0;
+           }
    }     
 }