BSIISX - Connecting Servo''s Correctly
Archiver
Posts: 46,084
Nick:
The red wire goes to +5 volts.
Black goes to gnd.
White goes to your Stamp pin.
I advise a 1K resistor in series to the stamp pin, it doesn't effect the
servo and provides protection to the Stamp.
Here is BS1 code that I have used to cycle servos back and forth. I am not
familiar with the SX, so you will have to convert the code. Pay special
attention to the PULSOUT...the SX probably uses different units of time.
This program generates 1 to 2 millisecs with a BS1, (Pulsout 100=10us*100=1
millisec). Also, check on the Pause statement, I don't know if it's the
same for the SX. For the BS1, Pause 15 is a 15 millisec delay. Also make
sure your power supply can support the current drain of a servo. Many
problems show up on this list because the power supply bogs down when the
servo moves, resulting in a Stamp reset.
Hope this helps,
Ray McArthur
'PROGRAM "SRVOTST1.BAS" 10/4/00
'TO TEST RC SERVOS
DIRS=%11111111
LOW 0
AGAIN:
FOR B2=100 TO 200 STEP 2
PULSOUT 0,B2
PAUSE 15
NEXT B2
FOR B2=200 TO 100 STEP -2
PULSOUT 0,B2
PAUSE 15
NEXT B2
'DEBUG "AGAIN"
PAUSE 1000
GOTO AGAIN
Original Message
From: <nick@m...>
To: <basicstamps@egroups.com>
Sent: Thursday, October 19, 2000 6:07 PM
Subject: [noparse][[/noparse]basicstamps] BSIISX - Connecting Servo's Correctly
> Im just starting out using the Basic Stamp 2 SX and I have two hobby
> servo's and the board that came with my development kit.
>
> The servos have three cables, black, red and white on a simple black
> plug that can connect to any of the pins on the board.
>
> Can somebody advise me which pins my servos could plug into and give
> me a example of a simple code that I could use to test them.
The red wire goes to +5 volts.
Black goes to gnd.
White goes to your Stamp pin.
I advise a 1K resistor in series to the stamp pin, it doesn't effect the
servo and provides protection to the Stamp.
Here is BS1 code that I have used to cycle servos back and forth. I am not
familiar with the SX, so you will have to convert the code. Pay special
attention to the PULSOUT...the SX probably uses different units of time.
This program generates 1 to 2 millisecs with a BS1, (Pulsout 100=10us*100=1
millisec). Also, check on the Pause statement, I don't know if it's the
same for the SX. For the BS1, Pause 15 is a 15 millisec delay. Also make
sure your power supply can support the current drain of a servo. Many
problems show up on this list because the power supply bogs down when the
servo moves, resulting in a Stamp reset.
Hope this helps,
Ray McArthur
'PROGRAM "SRVOTST1.BAS" 10/4/00
'TO TEST RC SERVOS
DIRS=%11111111
LOW 0
AGAIN:
FOR B2=100 TO 200 STEP 2
PULSOUT 0,B2
PAUSE 15
NEXT B2
FOR B2=200 TO 100 STEP -2
PULSOUT 0,B2
PAUSE 15
NEXT B2
'DEBUG "AGAIN"
PAUSE 1000
GOTO AGAIN
Original Message
From: <nick@m...>
To: <basicstamps@egroups.com>
Sent: Thursday, October 19, 2000 6:07 PM
Subject: [noparse][[/noparse]basicstamps] BSIISX - Connecting Servo's Correctly
> Im just starting out using the Basic Stamp 2 SX and I have two hobby
> servo's and the board that came with my development kit.
>
> The servos have three cables, black, red and white on a simple black
> plug that can connect to any of the pins on the board.
>
> Can somebody advise me which pins my servos could plug into and give
> me a example of a simple code that I could use to test them.