Nuvoton
/
NuMaker-mbed-GPIO_Interrupt
NuMaker GPIO Interrupt with Debounce Setting
main.cpp
- Committer:
- ccli8
- Date:
- 2017-05-04
- Revision:
- 6:b3369ce1a600
- Parent:
- 5:b9b7cd06aaf0
- Child:
- 8:a479ab0a14ef
File content as of revision 6:b3369ce1a600:
// GPIO interrupt to set led on/off #include "mbed.h" #if defined(TARGET_NUMAKER_PFM_NUC472) InterruptIn button(SW1); // Button SW1 DigitalOut led(LED1); // Flash LED1 #elif defined(TARGET_NUMAKER_PFM_M453) InterruptIn button(SW2); // Button SW2 DigitalOut led(LED1); // Flash LED1 #endif void flip() { led = !led; } int main() { button.rise(&flip); }