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

    adding analog support to my barcade

    Scheduled Pinned Locked Moved Help and Support
    controlretropie 4.4
    7 Posts 3 Posters 657 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.
    • G
      grant2258 Banned
      last edited by

      @mitu sorry to bother you since you seem to be really clued up on everything pi input related I would like to ask a quick question. Do you know if there is any way I could hook one of these up to a pi and get it to register as a input controller so i can add an input axis. I could turn an ardunio into a hid controller if need be if its not possible. I just want to add a quick axis controller for my barcade since joysticks are digital only.

      https://www.ebay.co.uk/itm/JoyStick-Module-X-Y-Dual-Axis-5V-PS2-Joystick-Controller-Arduino-Raspberry-PI/262442123548?epid=2126915148&hash=item3d1ac5011c:g:5QUAAOSwt8JZ4fAf&frcectupt=true

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

        Well, I'm not that skilled with electronic circuitry, but that joystick could fit the bill. I noticed it says 5V, so you might need a converter instead of a full Arduino board, since the PI's GPIOs are 3.3V LL.

        For the device you found, it seems there are a few tutorials already:

        • https://projects-raspberry.com/using-a-joystick-on-the-raspberry-pi-using-an-mcp3008/
        • https://retropie.org.uk/forum/topic/12277/how-to-set-up-mcp3008-adafruit-analog-joystick-rpi (with external links to the project).
        • https://github.com/virtualbjorn/Raspberry-Pi-3-Joystick-with-MCP3008 (with an additional 'driver' for the joystick).
        • RPI forum post started by the 1st tutorial link - https://www.raspberrypi.org/forums/viewtopic.php?t=144710

        Of course, you might have already found the links above and based on it you found the actual device :). As I said, I'm an expert, so take this with a grain of salt - maybe others can chime in.

        edmaul69E 1 Reply Last reply Reply Quote 0
        • edmaul69E
          edmaul69 @mitu
          last edited by edmaul69

          @mitu it should run just fine on 3.3v as it is. I have run tons of 5v controllers (including rapid fire controllers) at 3.3v no problem with analog sticks on them.

          1 Reply Last reply Reply Quote 1
          • G
            grant2258 Banned
            last edited by

            yea the voltage shouldnt be an issue i have a few of these lying about for ardunio projects from before cheers for the links!

            1 Reply Last reply Reply Quote 0
            • G
              grant2258 Banned
              last edited by grant2258

              The actual part of programming wiring it and reading the data isint a problem at all. The part i need help with is how to map it as joystick device. Ill read them guides in more detail thanks again

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

                @grant2258 Hm, looks like creating an analog joystick might not be so straightforward. The approach in the links I gave earlier are for either reading the values or for creating a digital joystick (like the Adafruit joystick bonnet). Most of the script use Pythong to create a joystick device using the uinput modules.
                I found one (so far) example (based on the 1st link) which seems to simulate an analog joystick with full axis movement based on the GPIO input at
                https://github.com/qubecad/Pi_stick/blob/master/analog_joycestick.py (from this page). I'm sure there are other solution, more user friendly, haven't found another one yet.

                As for integrating into games, I think you'll be presented with a standard joystick (/dev/input/js0) that can be read like any other joystick

                1 Reply Last reply Reply Quote 0
                • G
                  grant2258 Banned
                  last edited by

                  Well i could hack code into mame2003-plus to read it thats not a good global solution though so ill add it to my todo list which isint too long atm!

                  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.