![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Pulsador sin control de rebotes.
Diff: main.cpp
- Revision:
- 0:96f9ded8c217
--- /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