Home › Forums › PS2X PlayStation 2 Controller Library Support Forum › Pinout?
- This topic has 7 replies, 4 voices, and was last updated 12 years, 11 months ago by Bill.
-
AuthorPosts
-
November 26, 2012 at 12:06 pm #1660AnonymousInactive
So there’s a nicely labeled pinout for the controller from curios inventor, but there is nothing documenting the Arduino wiring. Once I’ve determined my:
Data, Command, Vibration Power, GND, VCC, ATT select, Clock, N/C, and ACK pins
How do those all match up with the Arduino? Thank you for your help as I realize I may have overlooked something on your site (I’ve been going in circles a little on here).
Also, you should look into typedef-ing your error codes and controllers. Gives your numbers a little more meaning and makes the code more readable.
// PS2 controller options
typedef enum {
kControllerUnknown,
kControllerDualShock,
kControllerGuitarHero
} kController;
November 26, 2012 at 12:08 pm #1661AnonymousInactive(just checking to be notified of future replies)
November 26, 2012 at 1:49 pm #1662AnonymousInactiveNevermind. It turns out you do not NEED the ACK pin. Thank you for the library! It still would help to be a little more explicit on your pinout.
November 27, 2012 at 8:29 am #1669BillMemberThe reason I’m not explicit on which pins on the arduino to connect to is because any pin on the arduino can be used. As long as your code matches the physical hookup.
ps2x.config_gamepad(13,11,10,12, true, true); //setup pins and settings: GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
- This reply was modified 13 years ago by Bill.
November 27, 2012 at 10:35 pm #1676AnonymousInactiveJust to clarify
Clock, Command and attention need to be on PWM pins
Data needs to be on a analog in pin and be pulled up
?
December 1, 2012 at 5:55 pm #1679BillMemberThere’s no special rules for what pin needs to be where. Any IO pin can be used for any signal wire, as long as you setup the config function correctly.
December 6, 2012 at 10:56 am #1695AnonymousInactiveI am also fairly new to this and trying to figure out how to wire to the Arduino…For the 4 pins you mentioned above (Clock, Command, ATT select, Data), I can just match the code in your program. As for the rest of them, I hook up the Power to the 5V pin, the Ground to the Ground, but what about the Vibration Power, N/C, and ACK pins?
At some point I’d like to see if I can get a motor controller hooked up using the PS2 and PWM. Does your code support different values based on position of the joystick that would work for that, or is it simply on/off?
Thanks for the help, I’ve been getting lots of good information out of your site as I’m still trying to learn this and get myself started.
December 24, 2012 at 1:03 pm #1739BillMemberRest of the pins just tape off.
Yes, take the analog values from the sticks and feed them to you motor controller. You might have to remap the number ranges to match the correct number range for your controller. -
AuthorPosts
- You must be logged in to reply to this topic.






