servo programming problem
dmehling
Posts: 25
I am trying to program my basic stamp 1 to control a servo and I seem to be having trouble positioning the servo correctly. I'm trying to get the servo to move from its minimum and maximum articulation, but it doesn't want to move. It acts like it's at its limit and cannot turn in a certain direction any further and it cannot seem to go the opposite direction either. Below is a sample of the code for my program.
' {$STAMP BS1}
Main:
PULSOUT 1, 500
PAUSE 8000
PULSOUT 1, 1000
PAUSE 8000
GOTO main
' {$STAMP BS1}
Main:
PULSOUT 1, 500
PAUSE 8000
PULSOUT 1, 1000
PAUSE 8000
GOTO main
Comments
' {$STAMP BS1}
Main:
for i = 1 to 20
PULSOUT 1, 500
PAUSE 20
next
for i = 1 to 20
PULSOUT 1, 1000
PAUSE 20
next
GOTO main
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
The PULSOUT values you’re both specifying are for the BS2 which uses 2us increments. The BS1 however uses 10us increments and so those values are way outside the range. You should be using values from 100-200 with 150 being the center pulse value.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen