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 DebouncedInterrupt.h
Revision | Date | Message | Actions |
---|---|---|---|
20:996ea2fc8d2d | 2014-02-21 | Updated Documentation | File Diff Annotate |
18:e6e9bc6402b7 | 2014-02-19 | Support checking rise and fall of signals | File Diff Annotate |
17:96a51b236ba0 | 2014-02-18 | Monitor both rising and falling edges | File Diff Annotate |
16:7eaa188de0f9 | 2014-02-18 | Default value for interrupt trigger | File Diff Annotate |
15:948e85b22efe | 2014-02-18 | Updates | File Diff Annotate |
14:da09706b92f5 | 2014-02-18 | Also poll pin value at the end of the debounce period | File Diff Annotate |
13:09b53a088a9c | 2014-02-18 | Change member function | File Diff Annotate |
12:7022ffaa74f5 | 2014-02-18 | Voila! volatile! | File Diff Annotate |
11:af6d7dc34062 | 2014-02-18 | Add documentation | File Diff Annotate |
10:cb16d2957f8d | 2014-02-18 | Allow DebouncedInterrupt to be set with just the PinName | File Diff Annotate | base |