how to control a hacked servo

My problem is to get my hacked servo to run both ways. I can make it run one way and stop. But the thing i want it to do is to run one way for 2 sec and then stop by giving it a command and then run 2 sec the orther way and then stop by giving it another command.
help me :slight_smile: please!
johanne

If the servo was hacked for continuous rotation by removing the motor controller. Than the direction of rotation is controlled by the pulse width. 1.0 - 1.5 ms Pulse width should turn it one direction and 0.5-1.0 pulse width would turn it another direction. The closer to 1ms from either direction the slower the rotation occurs.

If however, the hacking of the servo removed the motor controller and you are controlling the motor directly (on/off power) you'll need an h-bridge to control the motor bi-directionally. The h-bridge can be a chip or built from discrete components. A google search should provide a number of hits with good guidance.