Last Updated: February 11, 2007
Well, after my experiences with using PS2 controllers, I thought I'd start a "project thread" for the general advancement of the use of these controllers. Here, I'll post links and code that are known to work currently. Feel free to respond with any comments/questions and especially your observations or discoveries on anything about PS2 controllers.
Caption: Incase you are unfamiliar with PS2 controllers, these are what they look like. Left: Dualshock 2 clone, center: Pelican Chameleon wireless (PL-669), right: Sony Dualshock. Right Picture: Pelican Afterglo (see EDIT 2/11/2007 at bottom of post)
CURRENTLY KNOWN: Here is what information is already known about using PS2 controllers
Excellent Nuts & Volts article explaining the serial communication involved with PS2 controllers, there is code at the end for the BS2.
Here is a post from the BS2 forums that has updated code with the "rumble" feature enabled, as well as an "auto analog on and lock" feature. This is nice because you don't have to press the "analog" button each time you power up (If you didn't know, "analog" mode allows the 2 joysticks to be read, "digital" mode just reads the buttons).
For Javelin users...see attached code, it doesn't utilize rumble or auto analog on/lock (at least not yet...) but reads everything else fine.
EDIT: 10/8/2006: I have also attached the code that works for both wired and (Pelican) wireless controllers, auto analog on/lock works but I haven't tested the rumble feature (although there is code for it). The wireless Pelican doesn't have rumble anyways.
Here is a post for the SX that describes wireless control somewhat, as well as retrieving pressure readings from the buttons (there is code for the SX at the bottom).
CURRENTLY UNKOWN: Ok, hopefully those links should cover everything about using PS2 controllers. Now for what still needs to be figured out/done/verified.
Wireless control-after getting the wired controller working, we all wish for a wireless controller. However, it's not that simple. It seems that the playstation communicates differently with wireless controllers than it does wired controllers. I haven't been able to get a wireless controller working, and I've read mixed reviews on people getting a wireless controller to work.
EDIT 8/15/2006: see http://forums.parallax.com/showthread.php?p=599358
EDIT 10/8/2006: I got it working for the Pelican Chameleon wireless, see attached code.
Button pressure reading-perhaps not that useful, but a cool built-in feature that could could be tapped into...
Why sometimes certain Sony brand controllers won't work?-It's as simple as that. It may be the "newer" generation of controllers, or slight differences in manufacturing, but not ALL controllers seem to work.
MY EXPERIENCE: Ok, and finally...here is my experience with using PS2 controllers
DDR (Dance Dance Revolution) pad - it's a no name brand pad, and it works great! Shows up as a digital controller.
Clone of Sony Dualshock 2 controller - I think it's the same one you see on ebay for around $10. These look exactly like the Sony's but don't say "Sony" in the middle where it should (it's blank instead). Mine works great except that I've had quality issues with them (I had one where the joystick would not rebound. Perhaps the resolution isn't as good as on a real Sony too? Not sure, but if these are all you can get working, they will do the job.
Original Sony DualShock controller - I could NOT get this to work, but I know that lots people use these. For me, it won't read anything, not even the ID. Has a model letter "A". Refer to this post http://forums.parallax.com/showthread.php?p=571131
for this "model" issue. If you don't care to look at the link, basically, it seems that there are two different "models," designated by an "A" or an "H" at the bottom right of the box of text on the underside of the controller. EDIT 8/15/2006: appears that only the dual shock 2 controllers work (not DS1), although sometimes the DS2's dont work either.
Pelican Chameleon wireless controller- I could NOT get this to work either. The LED on the reciever blinks when I push a button, so the Tx to Rx communication seems to work fine. In addition, I can read the ID of this controller. I don't remember what byte its ID is returned as, but I know it changes if I push the analog button. However, I can't seem to initiate the data transfer, the status never comes back as "ready."
EDIT 8/15/2006: mountaineer has got this controller working, also see the thread about wireless controllers (linked above).
EDIT 10/8/2006: I got it working, see attached code.
EDIT 2/11/2007: Warning: don't connect the receiver to more than +5V (other controllers seem fine up to +7V, but mine stopped working)
Pelican Afterglo wired controller (ADDED 2/11/2007)-This works like a regular wired controller EXCEPT the "Set_Mode_Analog();" needs to be commented out from the constructor of the psxWiredAndWireless.java class. For some reason, this function locks the controller in digital mode instead of in analog mode. This controller, like the Pelican wireless, appears to have better quality joysticks that center at the same position everytime. The controller lights up blue when you connect the +7.5V wire that's supposed to power the rumble feature to another power source (don't connect it to a stamp's regulated +5V).
1) Added Pelican Afterglo controller, but I did NOT update the psxWiredAndWireless.java class. To use this controller, the Set_Mode_Analog(); call in the constructor must be commented out.
2) Added warning for Pelican Chameleon wireless
EDIT 10/8/2006: I edited the attachments:
1) "psx.java" is the code I was using that has auto analog on/lock and code for rumble (although I haven't tested)
2) "psxWiredAndWireless.java" is "psx.java" modified to work with Pelican wireless controllers and the regular wired controllers. It is exactly the same as psx.java except for 3 new data fields (boolean analogOn, pluggedIn, wireless) and data shifting for the wireless controller. When you use it, you should call "psx.update()" or "psx.Get_PSX_Packet_Fast()" so that it will automatically run the function to shift the data for the joystick values; otherwise, you will need to insert the code for the shifting function elsewhere. (Slightly changed 10/10/06)
3) "WirelessPS2.txt" contains my notes for my observations of the wireless Pelican controller
4) (Added 10/10/06) Small test class "psxWiredAndWirelessTest.java" added for use with "psxWiredAndWireless.java"
Post Edited (bulkhead) : 2/12/2007 6:42:24 AM GMT