Juan Angel García
/
9_11
Pulsador sin control de rebotes.
main.cpp
- Committer:
- jangelgm
- Date:
- 2017-03-09
- Revision:
- 0:96f9ded8c217
File content as of revision 0:96f9ded8c217:
/* 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; }