BS2SX Dual servo control
Hi There
I have been trying to learn how to program a Basic Stamp 2 SX to rotate 2
(hacked) servo motors in oppossite directions to each other and then back
the other way. I would ideally like to find out how to rotate them 180
degrees before they turn back again the oppossite way and keep the speed
real slow. Can anyone advise me what I am doing wrong with the code I am
using or e-mail me a working code. All I seem to get is both servos rotating
the same way and the PP3 battery's I use to power them dies out real quick.
The code I have been experimenting with is as follows :-
(found this code in the egroups message boards but this is my badly modified
version, so please be nice :->)
'{$STAMP2SX}
start:
for w1=900 to 1850 step 25
pulsout 0,w1
pause 20
next
for w1=1850 to 900 step 25
pulsout 0,w1
pause 20
next
for w1=900 to 1850 step 25
pulsout 1,w1
pause 20
next
for w1=1850 to 900 step 25
pulsout 1,w1
pause 20
next
goto start
Ohyes one other thing, how do I get the damn thing to stop without pulling
the plug?
I have been trying to learn how to program a Basic Stamp 2 SX to rotate 2
(hacked) servo motors in oppossite directions to each other and then back
the other way. I would ideally like to find out how to rotate them 180
degrees before they turn back again the oppossite way and keep the speed
real slow. Can anyone advise me what I am doing wrong with the code I am
using or e-mail me a working code. All I seem to get is both servos rotating
the same way and the PP3 battery's I use to power them dies out real quick.
The code I have been experimenting with is as follows :-
(found this code in the egroups message boards but this is my badly modified
version, so please be nice :->)
'{$STAMP2SX}
start:
for w1=900 to 1850 step 25
pulsout 0,w1
pause 20
next
for w1=1850 to 900 step 25
pulsout 0,w1
pause 20
next
for w1=900 to 1850 step 25
pulsout 1,w1
pause 20
next
for w1=1850 to 900 step 25
pulsout 1,w1
pause 20
next
goto start
Ohyes one other thing, how do I get the damn thing to stop without pulling
the plug?