See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE
See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE