Servo sweep on a schedule

Please modify your post and use the code button </>

so your code looks like this

and is easy to copy to a text editor. See How to use the Forum

You need a variable to keep track of whether the servo is okToSweep and that gets set to true or false at the appropriate time.

In the servoSweep() function you can check that variable - something like this

void servoSweep() {
  if (okToSweep == false) {
        return; // i.e. do nothing
   }
   // rest of the code
}

You can use the code from one of the LED functions, with changed times obviously, to change the value in okToSweep.

...R