Takumi Okamoto
/
InterruptIn_for_arch
SeeeduinoArchで割り込みのテスト
Revision 0:af7b276e73a7, committed 2014-03-09
- Comitter:
- MrBearing
- Date:
- Sun Mar 09 02:08:05 2014 +0000
- Commit message:
- firstcommit;
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 af7b276e73a7 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 09 02:08:05 2014 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" + +InterruptIn button(P0_23); +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); + } +} \ No newline at end of file
diff -r 000000000000 -r af7b276e73a7 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Mar 09 02:08:05 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59 \ No newline at end of file