Can you make a servo go from 0 to 180 then back 180 to 0 every 10 seconds

1 Response

  1. jestin says:

    Void loop(){
    servo.write(0);//write to 0
    delay(10000);// wait 10 seconds
    servo.write(180);// write to 180
    delay(10000);//again 10 seconds wait
    If you need to run other functions during this 10 seconds delay, then use millis() to servo write during every 10 seconds interval.

Leave a Reply

Your email address will not be published. Required fields are marked *