Author Options:

setting a delay on an Arduino code for a servo? Answered

I want to set a delay on a servo to take a couple seconds to run 180 degrees.
it is probably really easy but i can't seem to figure it out. Please write a code or any advise would be great!


Bear in mind that the servo wants to get to your demanded position as fast as possible: if you want to take longer, you need to do it in steps. Start at 0, wait a bit, move to 1, wait a bit, move to 2, wait a bit.

Basically, all you need is a for loop, counting position, and a delay in it./

You should post the code you've tried so far. As well as links to articles that you've found that do the same thing, then show us which bits don't make sense to you.