Servo Control

Hi can anyone help me.I want to sweep my servo from 180 to zero just one time without it continuously going through a loop.what code would i need to add to sweep example sketch to achieve this.Any help much appreciated.

delay(5000); ???

...R

Don't use analogWrite().

Put the code in setup.

Thank you for reply i tried this but am getting errors i think it concerns the curly brackets sorry but i am new to this

Make sure you have a loop() function even if it is empty.

piddy0504:
am getting errors

If you want help resolving errors, post your code (the whole lot, in code tags) and all the error messages.

Hi thanks for reply turns out i had 1 extra opening brace in the code