RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    How to begin writing drivers for an analog PS2 joystick module?

    Scheduled Pinned Locked Moved Help and Support
    wiringpianalog joystickc language
    7 Posts 2 Posters 628 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ian-rosenberg
      last edited by

      I have a PS2 joystick module, from SunFounder that has analog input for the x and y axis as well as a press-button. I know a bit of wiringPI, but how would I pass the inputs from the C program to retropie?

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Just implement a standard joystick/gamepad driver and it should be detected automatically. Take a look at xboxdrv's sources to see how it's done from userspace.

        1 Reply Last reply Reply Quote 0
        • I
          ian-rosenberg
          last edited by

          But it's not a USB input, it goes to BCM pins IO2 and IO3 on my RPi 3B.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            xboxdrv is not limited to USB only controllers, it is just an example on how to write a joystick/gamepad driver.
            Maybe something like https://github.com/tuomasjjrasanen/python-uinput would be simpler - read the inputs from your device and create a virtual joystick/gamepad which should be read by any programs supporting the standard evdev interface.

            1 Reply Last reply Reply Quote 1
            • I
              ian-rosenberg
              last edited by

              Alright, I appreciate the help!

              1 Reply Last reply Reply Quote 0
              • I
                ian-rosenberg
                last edited by

                Bumping because I honestly can't find a good starting point. I need to first figure out how to read analog input, because whatever I try seems to fail.

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @ian-rosenberg
                  last edited by

                  @ian-rosenberg Don't bump topics for no reason, it's rude.
                  If you can't figure out how to do things, try to find and example - did you look at the Adafruit's code ?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.