interrupting a for loop with button press

Open up your examples folder and look for BlinkWithoutDelay. I think it is in Digital.

That example is very simple. But can you see how it remembers if the light is currently on or off and when the time is up, it makes a decision to change it?