Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1660
    Anonymous
    Inactive

    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;

    #1661
    Anonymous
    Inactive

    (just checking to be notified of future replies)

    #1662
    Anonymous
    Inactive

    Nevermind.  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.

    #1669
    Bill
    Member

    The 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 11 years, 6 months ago by Bill.
    #1676
    Anonymous
    Inactive

    Just 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

    ?

    #1679
    Bill
    Member

    There’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.

    #1695
    Anonymous
    Inactive

    I 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.

    #1739
    Bill
    Member

    Rest 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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.