Quote Originally Posted by aratti View Post
I would apply a flag condition to control the key state.
This would still require some kind of debouncing. The logic state can "bounce" a number of times when pressing a button, so if it toggles back and forth a few times it could still advance the counter more than once for a single key press if the loop is quick enough.