1
\$\begingroup\$

How can you control a Servo using a Basic Stamp?

\$\endgroup\$
1

1 Answer 1

4
\$\begingroup\$

Servos' positions are determined by a pulse width signal with a repetition rate of typically 50Hz, so one pulse every 20ms.

enter image description here

The servo's neutral position (halfway) agrees with a 1.5ms pulse width. Shorter pulses will rotate the servo to the left, longer pulses to the right. So all you have to do is periodically create pulses. This document has a servo control demo on page 146. The code used in this demo is simply

PULSOUT Servo, (pWidth */ PwAdj)  ' move the servo
PAUSE 20                          ' servo refresh delay
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.