Look at:
IDE: File --> Examples --> 02.Digital --> BlinkWithoutDelay
Using millis() for timing. A beginners guide
Demonstration code for several things at the same time
State Machines
Look at:
IDE: File --> Examples --> 02.Digital --> BlinkWithoutDelay
Using millis() for timing. A beginners guide
Demonstration code for several things at the same time
State Machines