Timed servo door for chiken coop

Did you have a look at the sweep demo ?

if you want to deal with time, look at


Also, do yourself a favour and please read How to get the best out of this forum and post accordingly (including code with code tags and necessary documentation for your ask like your exact circuit and power supply, links to components etc).