5a9c1801b3ce0f604e8c470f6ac6a6163624660d
Arduino PS2 Controller Adapter
What's This?
This is a sketch for an Arduino Pro Mini-based adapter that converts DualShock 2 controller signals into XInput! This way, you can use PS2 controllers on any PC without extra software.
I also designed a 3D-printable case for the adapter, which you can find here!
Required Hardware
The linked parts are only references; feel free to use any compatible hardware or to edit the sketch to suit your hardware. No affiliate links.
- Arduino Pro Mini
- Microswitch to reset the Arduino
- PS2 controller extension cable (you'll need to cut off the female end of this cable to solder its wires to the Arduino)
- 0.96in display (optional)
Diagram
Note on Flashing
Flashing the XInput library makes the Arduino unresponsive to further flashing.
- Wire a switch between GND and RST to act as a reset switch
- Enable verbose output on upload in
Arduino IDE -> File -> Preferences - Select the COM port of the board and the corresponding board type as provided by the XInput library. For me, this was
Arduino Leonardo w/ XInput - Press "Upload"
- Once the notification in the bottom right says "Uploading", press the reset switch twice in quick succession
- On success, the output window should print out data, concluding with "avrdude done. thank you." You'll need to perform steps 4-6 on every flash as long as you have the Arduino configured for XInput. Find more information about this in the readme of the Arduino XInput library.
Required Libraries
- PS2X library for interpreting the controller's signals
- ArduinoXInput_AVR library for sending XInput commands via an Arduino Pro Micro
- Adafruit_SSD1306 library for display output
Further Useful Links
- PS2 controller wire diagram by Bill Porter
- Gamepad Tester for testing the controller in a web browser
Languages
C++
100%
