PDA

View Full Version : Servo Trouble with BS2SX - yes my pulsout value is correct!



stupidservos
11-27-2006, 12:26 AM
I hope somebody can help me with this.

I am trying to control a servo with the BS2SX but I cannot get it to do anything except bang against one of the stops·(always moving in the same direction).· I have tried a futaba servo, as well as a hitec servo and have tried all the code I can find on the net for servo control but it's always the same thing.· The servo has the correct leads connected to a 4.8V battery pack, with only the white signal wire connected to pin14 on the bs2sx.· This code should move from one extreme to the other·and back to center, but it only goes to one side and tries to keep going?!· I would appreciate any help on this.

This is the code I'm using:

' {$STAMP BS2sx}
' {$PBASIC 2.5}
counter VAR Word

FOR counter = 1 TO 150
PULSOUT 14, 2500
PAUSE 20
NEXT
FOR counter = 1 TO 150
PULSOUT 14, 1250
PAUSE 20
NEXT
DEBUG "Center 12 o'clock", CR
FOR counter = 1 TO 150
PULSOUT 14, 1875
PAUSE 20
NEXT
DEBUG "All done."
END

Martin Hebel
11-27-2006, 12:32 AM
You probably need a common ground between the battery pack and BS. Connect the grounds together.

-Martin

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control (http://www.stampplot.com/)
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers (http://www.selmaware.com/appbee)·

stupidservos
11-27-2006, 03:42 AM
It works!· Thanks alot, I didn't know what I was doing wrong.

·