torreta de patrulla y claxon

Dependencies:   mbed

Fork of frdm_excercise7 by Roberto Vázquez

Revision:
0:2190998da98e
Child:
1:83ed31fe1049
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 25 19:00:22 2014 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#define on 0
+#define off 1
+DigitalOut azul(LED_BLUE);
+DigitalOut rojo(LED_RED);
+InterruptIn sw2(SW2);
+DigitalOut verde(LED_GREEN);
+void task(void);
+int main()
+{azul=on;
+rojo=off;
+    while (true) {
+    azul=!azul;
+    rojo=!rojo;   
+    wait (1.0f);
+    sw2.rise(&task);   
+    }
+}
+void task()
+{verde=on;
+wait (5.0f);
+    }
\ No newline at end of file