2 servos sweep action

I need code to make 2 servos do their 180 degree cycle (at separate times) over 8 hours.

  1. servo 1 will go from 0 to full (180degrees) in 4 hours, then back for 4 hours (full to 0) - servo 2 will be doing nothing during this cycle.

  2. servo 1 will then stop for 16 hours (servo 2 will still be static)

  3. then after 24 hours in total (4 + 4 + 16) - vice-versa for servo 2 (whilst servo 1 is static)

and so on....

help needed asap. thanks

This is pretty simple. Think about how you would move them if you were moving them manually.

Check the time.
Is it time to move the first servo? If so, move it to the correct position.
Is it time to move the second servo? If so, move it to the correct position.

You'll need to keep track of each servos position and the start and end times of the servo movements. Use the current time's position between the start time and end time to determine where the servo should be now. If that's not where it is, move it.

The DateTime library will prove useful for you.

No power required except when moving to the next position, depending on ratio of motor size to (undisclosed) load.

Stepper motors need power at all times, too. What else would keep them from moving under the applied load?

servos are all I have. Not enough time nor money to buy extra hardware. Any coding available for this?

Any coding available for this?

There's some pseudo code in reply #1

..and how would this look in real coding?

Ok - I've hooked up one servo straight to the arduino board, uploaded the 'sweep' code and ran that. I have the arduino software yes, time related functions isn't something I've used thus far as far as I'm aware. I have a breadboard in order to run 2 servos off.

I need this done by tuesday!