torreta de patrulla y claxon

Dependencies:   mbed

Fork of frdm_excercise7 by Roberto Vázquez

Revision:
1:83ed31fe1049
Parent:
0:2190998da98e
--- a/main.cpp	Thu Sep 25 19:00:22 2014 +0000
+++ b/main.cpp	Thu Sep 25 19:21:05 2014 +0000
@@ -3,20 +3,25 @@
 #define off 1
 DigitalOut azul(LED_BLUE);
 DigitalOut rojo(LED_RED);
-InterruptIn sw2(SW2);
+InterruptIn but(SW2);
 DigitalOut verde(LED_GREEN);
 void task(void);
+void task2 (void);
 int main()
 {azul=on;
 rojo=off;
+verde=off;
     while (true) {
     azul=!azul;
     rojo=!rojo;   
-    wait (1.0f);
-    sw2.rise(&task);   
+    wait (0.5f);
+    but.fall(&task); 
+    but.rise(task2);  
     }
 }
 void task()
 {verde=on;
-wait (5.0f);
+    }
+void task2()
+{verde=off;
     }
\ No newline at end of file