blinking LED without delay()

Andy’s step sequencer was coming along nicely until he added a delay to blink his LED to visualise the tempo.  The delay would slow down the whole main loop, meaning that all other readings (like push buttons) had to wait for the end of the delay before they were activated.

Here’s Andy’s lovely breadboard:

It just can’t be possible that Arduino has such a fundamental flaw, can it?  Well, kinda, but it turns out the problem can be solved.  In fact, the solution was right under our noses…

Continue reading