Yet More Buttons! -- Single, Multiple, Matrix Add-a-Sketches

wvmarle:
Interesting take on the button problem.

The main issue I can find is that it pretty much relies on being called frequently. So no delay() or even a long Serial.print() statement is allowed (just 60 characters at the default 9600 bps and you're hitting your 60 ms mark already).
The solution to this would be a timer interrupt, so the buttons get read pretty much regardless of what else happens. But that again may cause clashes with other libraries that also want to use timers.

About print time and Serial baud. I do set the rate at 115200, do I need to comment that it's just to empty the output buffer quicker? I have before.

It's not great coding to overfill the serial buffer.

OTOH what if you do and hang things up to where the button read timer thinks that it hasn't been 500us since last read? The button would be unresponsive if the delay caused by overloading the serial output buffer fell in the 0 to 499 part or the 500 to 65535 part.

If the programmer wants to print a book to screen and have responsive buttons, it's up to the programmer to not block, to control the speed of data passed on to Serial.

65ms is 1040000 cycles. It's long enough to see.