Problem with PS2 wireless robot controller

Hi,

I’m starting off in robotics and I’ve just bought a bot board 2, BS2 and a PS2 robot controller.
The BS2 and the bot board are working fine, but I just don’t quite get how to program the PS2 controller.

I have two questions which I hope you will be able and willing to answer :

  1. Where do I plugin in the controller’s green wire ?
  2. Which software, language and libraries should I be using to get started ?

Thanks in advance for your help.

We have sample code for running the PS2 from a BS2 using the older version of the Bot Board. Earlier versions of the board had the inverter for the clock line (iirc) But the current Bot Board II does not. There is a software fix, but it takes a lot of the BS2’s already anemic resources to make it work. Not anything left over for the application.

First, thanks for helping me! :mrgreen:

I’ve found a good program,:

[code]’{$STAMP BS2}
clk CON 7
att CON 6
dat CON 4
cmd CON 5
PS2B1 VAR Byte
PS2B2 VAR Byte
PS2B3 VAR Byte
PS2B4 VAR Byte
PS2B5 VAR Byte
PS2B6 VAR Byte
char VAR Byte
temp1 VAR Word
temp2 VAR Word
temp3 VAR Byte

’ Read PS2 Controller
read_PS2

LOW att

SHIFTOUT cmd, clk, LSBFIRST, $01,$42]
SHIFTIN dat, clk, 3, [char]
temp3 = char

SHIFTIN dat, clk, 3, [char]
PS2B1 = char

SHIFTIN dat, clk, 3, [char]
PS2B2 = char

SHIFTIN dat, clk, 3, [char]
PS2B3 = char

SHIFTIN dat, clk, 3, [char]
PS2B4 = char

SHIFTIN dat, clk, 3, [char]
PS2B5 = char

SHIFTIN dat, clk, 3, [char]
PS2B6 = char

HIGH att

temp1 = ((PS2B3 * 4) + 250) MIN 350 MAX 1150 'MIN 250 MAX 1250
temp2 = ((PS2B4 * 4) + 250) MIN 350 MAX 1150 'MIN 250 MAX 1250

PULSOUT 12, temp1
PULSOUT 13, temp2
PAUSE 20

’ DEBUG DEC temp1, " ", DEC PS2B3, " ", DEC temp2, " ", DEC PS2B4, CR
’ debug dec temp3, " ", cr
’ DEBUG BIN PS2B1, " ", BIN PS2B2, " ", DEC PS2B3, " ", DEC PS2B4, " ", DEC PS2B5, " ", DEC PS2B6, CR

exit_read_PS2

GOTO read_PS2

RETURN[/code]

lynxmotion.com/images/html/build036.htm

But instead of having 255 255 128 121 134 139
I’ ve got 0, 255, 1111111,…
Is my PS2 controller not working properly ?

Yes that is the program we used when the Bot Board had the inverter for the BS2. It no longer has the inverter on the clock, so the program will no longer work. You need an Atom Pro. Ther BS2 can’t be used without making a hardware modification… the inverter. :wink:

Can’t I do anything?
Because Robotshop says:“Excels with the Basic Atom or Basic Atom Pro, accepts all BS2, OOPic-C or BasicX microcontrollers”
Should I ask robotshop what to do?

I have told you what you need to do more than once. Make an inverter using a transistor or a logic gate. When the clock is inverted it will work. The statement robot shop has made does not specifically mention ps2, so there’s nothing to get on to them about. Robot Shop does not know the intimate technical details, they are just a reseller. You are at the right place to get the help and information you need. If you don’t want to make an inverter then you need an Atom Pro.

Ok thank you for helping me.

But were should I plug the transitor and which transitor should I use?

You might want to google up the subject. Usa a 2N4401 or 2N3904 or 2N2222. Use 10k on the input and 1k on the output. Use this circuit.

http://www.kpsec.freeuk.com/images/trinvert.gif