Nicolas Mosquera / Mbed 2 deprecated EjeDMIC2021_2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
nicmoseli
Date:
Wed Aug 25 20:32:38 2021 +0000
Parent:
1:b903d66801e3
Commit message:
bugs fix, button added

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Aug 25 20:11:08 2021 +0000
+++ b/main.cpp	Wed Aug 25 20:32:38 2021 +0000
@@ -1,7 +1,21 @@
 #include <mbed.h>
 
+DigitalOut myled(LED1);
+DigitalIn btn(BUTTON1);
 
 int main (void)
 {
-    
+    while(1){
+        if(btn == 0){
+            myled = 1;
+            wait(0.1);
+            myled = 0;
+            wait(0.1);
+        }else{
+            myled = 1;
+            wait(0.2);
+            myled = 0;
+            wait(0.5);           
+        }
+    }
 }
\ No newline at end of file