ironbot:
True, can't do software debounce for I'm on ISR, no delay() !
Not true at all.
Two common ways as follows:
- Disable interrupt in the ISR on first contact and record time to a global variable. Reenable interrupts in the loop after a bounce guard time.
- or -
- Record time to a static variable in the ISR on first interrupt. Ignore successive interrupts until guard time has elapsed.