Controlling servo direction with arduino Answered
So, I'm trying to control two servo motors for a robotic arm. I can't seem to figure out how to make two servos go opposite directions at the same time. This is needed as I have two servos facing opposite directions driving the same beam (If they're told to go the same direction, because they are facing opposite directions, they'll rotate opposite directions).
Currently I'm using this code to rotate them both:
for(pos = 0; pos < 180; pos += 1)
and then using the same code, only replacing the top part with
for(pos = 180; pos>=1; pos-=1)
to return to the original position.
How do I make both servos go opposite directions though, so they can both be used to lift a beam at the same time?