FRDM-K64 Interrupt basic demo

Dependencies:   mbed

Revision:
0:5d8424654e0e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 09 19:31:07 2014 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+
+
+DigitalOut Red(LED1);
+DigitalOut Blue(LED3);
+InterruptIn Interrupt(SW2);
+
+
+void blink()
+{
+    wait(.4);
+    Red=1;
+    Blue=0;
+    wait(.4);
+    Blue=1;
+    wait(.4);
+}
+
+int main() 
+{
+    Interrupt.fall(&blink);
+    Blue=1;
+    while (1) 
+    {
+        Red=!Red;
+        wait(.4);
+    }
+}
\ No newline at end of file