debounce problem

ironbot:
True, can't do software debounce for I'm on ISR, no delay() !

Not true at all.

Two common ways as follows:

  1. 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 -
  1. Record time to a static variable in the ISR on first interrupt. Ignore successive interrupts until guard time has elapsed.