Using a PS2 Dualshock Controller with Raspberry Pi

PDF24    Send article as PDF   
I have spent the weekend experimenting with my Raspberry Pi’s. One challenge I set myself was to get a Sony PS2 Dualshock Controller working with Raspberry Pi. The main reason for this, was to allow me to control a BrickPi Robot without using a Mindsensors PS2 Controller Adapter connected to the Brick Pi. This leaves access to the maximum number of four NXT Sensor Ports on the BrickPi Board.

PS2 Controller Adapter

I began with a PS2 Controller and a Sony PS2 USB Controller Adapter/Converter pictured above. This adapter allows you to connect a PS2 Dualshock Controller to a Raspberry Pi via a spare USB port on the Raspberry Pi. The Sony PS2 USB Controller Adapter/Converter set me back a whopping $2.28AU on eBay.

Preparing the Raspberry Pi:

Open a Terminal on the Raspberry Pi and begin by installing the “joystick” application:

sudo apt-get install joystick

Now simply connect PS2 Controller to the adapter, and then plug the other end of the adapter into a Raspberry Pi USB Port. Once connected RESET the Raspberry Pi:

sudo reboot

Now check that the PS2 Controller is detected by the Raspberry Pi:

jstest /dev/input/js0

If you receive errors, try using jstest /dev/input/js1 or jstest /dev/input/js2. I found mine was connected via /dev/input/js1.

Once you have found where the PS2 Controller is located run:

jscal /dev/input/js0

And that’s it! You can now use a Sony PS2, Dualshock Controller with Raspberry Pi.

 

Previous Post
USB-to-serial Console Cable

Raspberry (Banana) Pi to PC using a Serial Connection

Using a Connection via a Serial Port is a low-level way to send data between the Raspberry (Banana) Pi and another computer system. There are two main ways in which ... Read more

Next Post
 Waveshare DVK512

Waveshare DVK512 Expansion Board for Raspberry Pi B+

Whilst searching DX.com, I came across the Waveshare DVK512 Expansion Board suitable for both Raspberry Pi B+ and Banana Pro. The Waveshare DVK512 Expansion Board comes equipped is 4x user ... Read more

Short URL: http://tinyurl.com/htntkra

Leave a Reply

Your email address will not be published. Required fields are marked *



Do NOT follow this link or you will be banned from the site!
error: Content is protected !!