Thanks so much, guys!

Elperepat: I'll check out that button library, it looks like overkill for what I'm doing, but maybe I need that? For example it handles stuff like double and triple clicks. I didn't think I needed that, but the more I think about it, the more I think that sort of thing could be useful.

Mark:
Quote:
The idea of good debouncing is to continue the debounce interval until the button has stopped changing state for a specified period. Not to simply wait 200msecs and take the new value at the end of it all.


Yes, this exactly! Thanks so much for the code. I will try it out. Although your code polls in a loop for the button, I would need to convert it to work with interrupt-driven buttons and see how it does in that case. I've found that loop-polling the button detection is inherently less noisy than interrupt-driven buttons, but that basic concept of debouncing should work for both polling methods.
_________________________
Tony Fabris