Putting robotics at your service™

Free shipping on orders over $200

Problem with PS2 wireless robot controller

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 8 posts ]

New ( offline )
Posts: 4
Posted: 2011-08-07 14:36 
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.


User avatar
Guru ( offline )
Posts: 9257
Posted: 2011-08-08 12:51 
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.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


New ( offline )
Posts: 4
Posted: 2011-08-08 16:34 
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


http://www.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 ?


User avatar
Guru ( offline )
Posts: 9257
Posted: 2011-08-08 17:58 
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. ;)

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


New ( offline )
Posts: 4
Posted: 2011-08-09 04:45 
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?


User avatar
Guru ( offline )
Posts: 9257
Posted: 2011-08-09 10:08 
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.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


New ( offline )
Posts: 4
Posted: 2011-08-10 11:43 
Ok thank you for helping me.

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


User avatar
Guru ( offline )
Posts: 9257
Posted: 2011-08-10 12:17 
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.


_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


 

All times are UTC - 5 hours [ DST ]. It is currently 2014-10-31 10:13
Feedback Form
Feedback Form