servo steering
kimm
Posts: 2
please can you tell me what is wrong in this listing
I have a bs2 and a standard servo.
I try to let the servo turn clockwise/anticlockwise in a loop
but the servo turns only in one direction depending on the
first pulsout value and then stops.
counter VAR Word
For counter = 1 to 10
Pulsout 15, 800
Pause 50
Next················ ' stops
For counter = 1 to 10
Pulsout 15, 200
Pause 50
Next
j.g.reuser@hetnet.nl
I have a bs2 and a standard servo.
I try to let the servo turn clockwise/anticlockwise in a loop
but the servo turns only in one direction depending on the
first pulsout value and then stops.
counter VAR Word
For counter = 1 to 10
Pulsout 15, 800
Pause 50
Next················ ' stops
For counter = 1 to 10
Pulsout 15, 200
Pause 50
Next
j.g.reuser@hetnet.nl
Comments
Your first loop gives 800 x 2uS = 1.6 mS which is pretty close to center position.
Your second loop gives 200 x 2uS = 0.4 mS which is probably ignored by the servo as being too fast.
Change your pulse values to give 1mS for one extreme and 2mS for the other.
Also, as shown, your program only executes once.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Thanks for the replay.
I have made the first pulsout = 200 The second pulsout = 800
and it's the same faulty result (stops for the first "next")
Even if I made both pulsouts the same 800 then the prog. stops
by the first "Next".
This is also in the docs on the Parallax site where the servos are described.
Cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·