look in the Examples, try out "BlinkWithoutDelay", you thank me later 🙂 - Arduino