Implementar un programa con la estructura de control do while, de tal forma que al iniciar el programa permita visualizar el destello de un LED durante 5 veces en un lapso de 3 segundos, posteriormente realizar la misma secuencia siempre y cuando dos botones estén presionados al mismo tiempo (utilizar leds y botones de la tarjeta).

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
nervy
Date:
Sun Apr 12 04:02:25 2020 +0000
Parent:
24:7f14b70fc9ef
Commit message:
e6p4

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Apr 08 11:03:25 2019 +0100
+++ b/main.cpp	Sun Apr 12 04:02:25 2020 +0000
@@ -1,12 +1,37 @@
-#include "mbed.h"
+#include "mbed.h" //librería que nos permite utilizar comandos y sentencias propias de mbed
 
-DigitalOut myled(LED1);
+DigitalIn taylorswift(SW2);
+DigitalIn kemonito(SW3);
+Serial com1(USBTX, USBRX);
+DigitalOut fuckito(LED1);
 
-int main() {
-    while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
-    }
-}
+int main()
+{
+    do
+        {
+    fuckito = 1; 
+    wait(.3);  
+    fuckito = 0;  
+    wait(.3); 
+    
+    fuckito = 1; 
+    wait(.3);  
+    fuckito = 0;  
+    wait(.3); 
+         
+    fuckito = 1; 
+    wait(.3);  
+    fuckito = 0;  
+    wait(.3); 
+    
+    fuckito = 1; 
+    wait(.3);  
+    fuckito = 0;  
+    wait(.3); 
+    
+    fuckito = 1; 
+    wait(.3);  
+    fuckito = 0;  
+    wait(.3); 
+        }while(taylorswift==1 && kemonito==1);
+}
\ No newline at end of file