Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Fri May 09 15:34:11 2014 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d10d1e4ecd6b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 09 15:34:11 2014 +0000
@@ -0,0 +1,26 @@
+/*
+  On KL25Z interrupts only works on ports A and D
+  Options are: raise and fall
+*/
+
+#include "mbed.h"
+ 
+InterruptIn button(PTD4); //D3
+DigitalOut led(LED1);
+DigitalOut flash(LED3);
+ 
+
+void flip();
+ 
+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);
+    }
+}
+
+void flip() {
+    led = !led;
+}
\ No newline at end of file
diff -r 000000000000 -r d10d1e4ecd6b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 09 15:34:11 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file