servo problem
Cyrill
Posts: 3
Hi
Who can explain with a little program ,how I can rotate two servo's at the same time
For now I can rotate them after each other.
But what should is ,for example
servo_1 rotate for ever between
For pulse =·1200 to 1800 step 8 and then from pulse 1800 to 1200
and at the same time
servo_2 rotate for ever between 1400 to 1600 step 10 and then from
pulse 1600 to 1400
thanks for any information
Cyrill
Who can explain with a little program ,how I can rotate two servo's at the same time
For now I can rotate them after each other.
But what should is ,for example
servo_1 rotate for ever between
For pulse =·1200 to 1800 step 8 and then from pulse 1800 to 1200
and at the same time
servo_2 rotate for ever between 1400 to 1600 step 10 and then from
pulse 1600 to 1400
thanks for any information
Cyrill
Comments
Start:
· servo1 = 1200
· s1dir = 0
· servo2 = 1400
· s2dir = 0
Main:
· DO
··· PULSOUT S1, servo1
··· PULSOUT S2, servo2
··· PAUSE 20
··· IF (s1dir = 0) THEN
····· servo1 = servo1 + 8
····· IF (servo1 >= 1800) THEN
······· s1dir = 1
····· ENDIF
··· ELSE
····· servo1 = servo 1 - 8
····· IF (servo1 <= 1200) THEN
······· s1dir = 0
····· ENDIF
··· ENDIF
··· IF (s2dir = 0) THEN
····· servo2 = servo2 + 10
····· IF (servo2 >= 1600) THEN
······· s2dir = 1
····· ENDIF
··· ELSE
····· servo2 = servo2 - 10
····· IF (servo1 >= 1600) THEN
······· s2dir = 0
····· ENDIF
··· ENDIF
· LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
If you REALLY need both to move at exactly the same time (like it's driving a pen for writing) -- well, I don't know that you can do this.