PaulS:
otherwise the mode change will be so fast you'll end up with a random selection.
In my code, the mode changes only once each time the switch is pressed. The speed at which it changes depends entirely on how fast the user presses and releases the switch.
Ouch! Your're right. There's the debouncing problem though... Without delay (or timed polling) the digitalRead() call will detect state changes while the button switch bounces.