![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
FRDM-K64 Interrupt basic demo
Diff: main.cpp
- Revision:
- 0:5d8424654e0e
diff -r 000000000000 -r 5d8424654e0e main.cpp --- /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