Servo Control
I've got a simple servo issue. Please see the code below - when I run this code, my expectation is that the servo will rotate X degrees clockwise, then X degree counterclockwise (back to it's original position). What is happening is that it returns more to the counter-clockwise position so that it's ultimate rotation slowly rotates backwards. I'm new to this so I'd appreciate any help discovering what my issue is. thanks,
do
pulsout 12, 650
pause 10
pulsout 12, 850
pause 10
loop
do
pulsout 12, 650
pause 10
pulsout 12, 850
pause 10
loop
Comments
Try this:
a:for b0=1 to 20 ' first loop 20X
pulsout 12,650
pause 20
next' end first loop
for b0=1 to 20' second loop 20X
pulsout 12,850
pause 20
next' end second loop
goto a'··········· lather, rinse, repeat
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
FOR Pulses = 650 TO 850 STEP 5
PULSOUT Servo, Pulses
PAUSE 20
NEXT
This results in smooth movement between 650 to 850.