Help with code

Im trying to write a code which moves a servo from 0 degrees to 180 degrees then holds it at 180 degrees for 30 seconds then return it to 0 degrees and then repeat the same thing in 24 hours
but I don't know how to code Arduino yet any help would be really appreciated
Thanks
Enzo :slight_smile:

I would firstly read through this post. It is very informative, and gives some snippets to do a lot of the basics, including a small part on servos.

http://forum.arduino.cc/index.php?topic=261445.0

As for the 24hour issue, look up millis() function.

Have a look at the servo sweep example in the IDE. It does a lot of what you describe, albeit over a shorter timescale.

Have a look at the servo sweep example in the IDE.

The above sketch does exactly what you want just add a 30 second delay between the for loops and a 24 hour delay at the bottom .

M.....