I'm currently working on an arduino code for a line follower competition. The rules say the robot has to wait on many occasions during his circuit. (Like when it detects a red zone it has to wait 4 seconds then keep going).
So inside my loop I have my readSensors() function which should keep reading at regular intervals. How should I implements the delays to make the robot wait without stopping other stuff like readSensors() function ?
First circuit :
Second circuit :
Notice the various stops throughout the circuits.