replace delay()

Look at the MultiBlink code in the Playground. It is designed to do what you seem to need.