Juan Angel García
/
9_11
Pulsador sin control de rebotes.
Revision 0:96f9ded8c217, committed 2017-03-09
- Comitter:
- jangelgm
- Date:
- Thu Mar 09 21:48:19 2017 +0000
- Commit message:
- Pulsador sin control de rebotes.
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 96f9ded8c217 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 09 21:48:19 2017 +0000 @@ -0,0 +1,18 @@ +/* Program Example 9.11: Toggles LED1 every time p18 goes high. Sin rebotes. +*/ +#include "mbed.h" + +InterruptIn button(p5); // Interrupt on digital pushbutton input p18 +DigitalOut led1(LED1); // mbed LED1 + +void toggle(void); // function prototype + +int main() +{ + button.rise(&toggle); // attach the address of the toggle +} // function to the rising edge + +void toggle() +{ + led1=!led1; +} \ No newline at end of file
diff -r 000000000000 -r 96f9ded8c217 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 09 21:48:19 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file