Im currently trying to program my arduino to open and close a valve using a servo. I need the servo to move 180 then back to 0 in as quick a time as possible, i then need a delay of about 15-20 seconds between that movement... Thanks!
I need the servo to move 180 then back to 0 in as quick a time as possible
So, what have you tried? This is NOT the homework hotline where we do your homework for you.
i then need a delay of about 15-20 seconds between that movement
No can do. You can have a delay of EXACTLY 15 seconds or EXACTLY 20 seconds or EXACTLY some value in between. Fuzzy logic doesn't cut it.
well what i meant was 15 or 20, my bad. I just need it to first be at 0, go to 180, wait a sec or two then back to 0 for the delay time, then repeat
OK. I will. What have you tried?
myself, nothing. My buddy has tried changing some example scripts but we are both bad at this
Have either of you looked at the Sweep example in the IDE ?
It does not move as fast as possible but it will get you started and let you experiment with the servo to make sure that it is wired correctly. Once you know that it works then making the servo move directly from 0 to 180 is trivial, as is adding a wait at 180 degrees using either a simple but limiting method or a slightly more complicated but more flexible method.
Feel free to post your programs here even if they don't work as required but please include a description of what they should do, what they actually do and/or any error messages.