View Single Post
Old 09-17-2013, 04:44 PM   #12 (permalink)
nickdigger
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
The keypress should be recognized when the key is released, and returns to "buttonsUp" -- provided it has passed the debounce period (nominally 29ms in the posted code, but a lower value might work too), For a quick keypress, this should appear to be instant, since the timer2 ISR is firing every 1msec. You could probably also trigger it, after passing the LongPress threshold, and not wait for buttonsUp.

The one difference i can think of, is that an extra variable, buttonGood, is now required. It wasn't needed before, because PCINT_vect was detecting pin changes on that port.
  Reply With Quote