6648Views3Replies

Author Options:

Can I reverse servo direction in Arduino? Answered

On my robot, both servos move clockwise. Is there any way in the  Arduino Environment to reverse the direction of one, to make it move counter-clockwise? 

3 Replies

user
gmxx (author)2010-01-22

 you could use the map function to remap the extremes of the servo, or give it the alternate value. what are the servos used for?

Select as Best AnswerUndo Best Answer

user
DELETED_afw11 (author)gmxx2010-01-23

They are being used as a motors and wheels for my Arduino based robot, one on each side of the robot. Because I flipped it, one servo is now going in the opposite direction.

Select as Best AnswerUndo Best Answer

user
gmxx (author)DELETED_afw112010-01-23

so you have continuously rotating servos? feed the servo the inverse value. using pwm on my arduino, one servo is mapped to 1-180 degrees by default. for the flipped servo, feed it the values from 180-1 (so that one servo will get 180 degrees sent and the other is given 1)

If it bugs you to have to send two values like that, use the map function to map all the values from 1-180 to 180-1. then both will have te sam mapping scale, but one will receive the flipped values

Select as Best AnswerUndo Best Answer