Use millis() instead of delay for timing.
For example, study the "blink without delay" program that comes with the Arduino IDE. Be sure that all time-related variables are unsigned long. Tutorial here.
Use millis() instead of delay for timing.
For example, study the "blink without delay" program that comes with the Arduino IDE. Be sure that all time-related variables are unsigned long. Tutorial here.