mX mbed BaseBoard Ext. Int.

Dependencies:   mbed

Revision:
0:09eedb45b600
diff -r 000000000000 -r 09eedb45b600 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 08 06:23:52 2010 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+InterruptIn button(p11);
+DigitalOut led(LED1);
+DigitalOut flash(LED4);
+
+void flip() {
+    led = !led;
+}
+
+int main() {
+    button.rise(&flip);  // attach the address of the flip function to the rising edge
+    while(1) {           // wait around, interrupts will interrupt this!
+        flash = !flash;
+        wait(0.25);
+    }
+}