Go Down

Topic: hardware debounce filter tutorial (Read 2 times) previous topic - next topic

schwingkopf

Thanks stimmer for correcting my little mistake with ms and s  :smiley-red: and for coding this nice function.. its very handy to use ;)

As a comment to users of your function I would like to point out that the rejection time is set for the whole port, so if you want to use different rejection times, your pins have to be on different ports.

chriskner

Considering the number of push-buttons and encoders that are unceremoniously tacked onto hardware, and the angst that non-debounced inputs can impart on a poor DUE, I humbly suggest that this thread get pinned.

Neat-tricks / feature utilization...

stimmer


Thanks stimmer for correcting my little mistake with ms and s  :smiley-red: and for coding this nice function.. its very handy to use ;)

As a comment to users of your function I would like to point out that the rejection time is set for the whole port, so if you want to use different rejection times, your pins have to be on different ports.


Thanks. I've modified the function so now if you use setDebounce(pin,0); to cancel the filter it doesn't affect the timing of the rest of the port.

Go Up