For some reason, I can't understand why my servo will only move to the position of the first servo position's loop and then ignore everything else. I tried both pulsout as well as HIGH/LOW loops. It will move to the first position just fine, then stop there. I thought my servo was bad, I plugged it into my Basic Stamp board and everything was fine. The servo runs off a separate power supply, so it can't be a power issue.
It appears that it is not stuck in any loop or anything since I inserted an LED to blink in between changing of the servo positions, and the LED blinks properly. What gives??
Here's my code if anybody can decipher and help me with this problem (both has the exact same problem, they both only move to the first position)
P.S.
I'm using a 16F876A with a 4mhz resonator, hence the pulsout numbers 200 and 100 for 2ms and 1ms respectively.
=========HIGH/LOW version =============
main:
for x = 1 to 100
high servo
pause 2 '<----it only positions in this loop
low servo
pause 20
next
for x = 1 to 100
high servo
pause 1
low servo
pause 20
next
goto main
==========here's my pulsout version ============
main:
for x = 1 to 100
pulsout portc.6, 200
pause 20
next
for x = 1 to 100
pulsout portc.6, 100
pause 20
next
goto main
Bookmarks