A replacement for InterruptIn that debounces the interrupt.
Dependents: D7A_Demo-Get-started CVtoOSCConverter EE3501keypad D7A_Localisation ... more
Fork of DebouncedInterrupt by
Example code:
#include "DebouncedInterrupt.h" DebouncedInterrupt up_button(USER_BUTTON); void onUp() { // Do Something } int main() { // Will immediatly call function and ignore other interrupts until timeout up_button.attach(&onUp, IRQ_FALL, 1000, true); // Will call function only if button has been held for the specified time //up_button.attach(&onUp, IRQ_FALL, 500, false); while(1) {} }
Revisions of DebounceInterrupts.h
Revision | Date | Message | Actions |
---|---|---|---|
8:4b3ff16d5f91 | 2014-02-18 | lock debounce count | File Diff Annotate |
7:2d73e219dadf | 2014-02-18 | Add counter for debounced interrupts | File Diff Annotate |
5:3c0f741fb448 | 2014-02-18 | Added example usage | File Diff Annotate |
4:19689187352e | 2014-02-18 | Add enum for interrupt trigger | File Diff Annotate |
3:e4b7033508d1 | 2014-02-18 | Cleanup | File Diff Annotate |
2:a50151994483 | 2014-02-18 | Readability changes | File Diff Annotate |
1:ffacad1b455a | 2014-02-18 | Comment cleanup | File Diff Annotate |
0:ca5a0fee9f52 | 2014-02-18 | Init version of class to debounce InterruptIn | File Diff Annotate |