Controlling 2 or more servo's with the USB servo controller board on the PDB!
NEED HELP!!!!
I have the PDB board and the USB servo controller board and I am trying to control two or more servo's but don't under stand the code!
Can someone PLEASE help with the code to move two servos with this type of configuration!
I have the connection correct "I think!" and when I try the code in the USB Servo controller doc nothing happens!·I see that the light is blinking on the Servo controller·due to the pulse but·No servo movement!· I also have the 24psx module on the PDB board!
What am I doing wrong?·This is very frustrating because·there is no docs on the new PDB board and only on the BOE. ·If someone could just write me code that would move even one servo I could modify it to move more!
Please help!
Joe
I have the PDB board and the USB servo controller board and I am trying to control two or more servo's but don't under stand the code!
Can someone PLEASE help with the code to move two servos with this type of configuration!
I have the connection correct "I think!" and when I try the code in the USB Servo controller doc nothing happens!·I see that the light is blinking on the Servo controller·due to the pulse but·No servo movement!· I also have the 24psx module on the PDB board!
What am I doing wrong?·This is very frustrating because·there is no docs on the new PDB board and only on the BOE. ·If someone could just write me code that would move even one servo I could modify it to move more!
Please help!
Joe
Comments
·· There's no BS2psx module.· Do you have the BS2px or the BS2sx?· Either way you will most likely have to change the baud rate parameters since they're for the BS2.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
··· TMidi······ CON···· 12
··· T38K4······ CON···· 6
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
··· TMidi······ CON···· 60
··· T38K4······ CON···· 45
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
··· TMidi······ CON···· 108
··· T38K4······ CON···· 84
#ENDSELECT
SevenBit······· CON···· $2000
Inverted······· CON···· $4000
Open··········· CON···· $8000
Baud··········· CON···· T2400 + Open
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
This is the code I am trying to use to test the servos and it will not work, any guesses?
I think I am using the correct baud rate of 396 for the BS2px chip
' {$STAMP BS2px}
' {$PBASIC 2.5}
ch VAR Byte
pw VAR Word
ra VAR Byte
x VAR Byte
Buff VAR Byte(3)
Sdat CON 1
Baud CON 396
Init:
ra = 15: ch = 0
DO
pw = 1240: GOSUB WRservo
pw = 240: GOSUB WRservo
LOOP
WRservo:
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
FOR x = 0 TO 4
PAUSE 1000
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCRSP", ch, CR]
SERIN Sdat, Baud, 1000, Init, [noparse][[/noparse]STR Buff\3]
DEBUG "Servo ", DEC buff(0), " ", HEX2 buff(1), " :", HEX2 buff(2), CR
NEXT
RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Worked like a charm, the only problem I had was my 7.2 V battery for the servo's kept dying and I need to get a new one.
Thanks again,
Joe