I'm looking for an easy way on breaking loop() on button.isPressed(). Or is there a way you can check a condition after every line in a loop?
I could make a really complex for loop but I'm trying to find a two or three lines instead of 100+.
If you REALLY need to check the switch state that often, the switch should be wired to an interrupt pin, and an interrupt service routine should be called.
The loop function is called in an endless loop, as many as 16,000,000 times a second. If you can't wait 62 nanoseconds to determine that the button is pressed, there may be issues with the code that you have that are making loop take too long.
I Started over the code and now I have an led instruction counter that is incremented against a millis() argument. It checks if the instruction number matches is in an array for each pin and turns it on accordingly.
The button push now happens with no problem and even causes the flash sequence not to lose place.