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

    Hint: Using 13 Buttons on GPIO

    Scheduled Pinned Locked Moved Help and Support
    gpiohotkeyhow-to
    1 Posts 1 Posters 957 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.
    • LolonoisL
      Lolonois
      last edited by Lolonois

      Hi guys and gals

      For those who are in need to drive 13 buttons (4 directions, 9 function buttons) via GPIO and using up to two joy panels in their build without having to use a GPIO extender like MCP23017.

      1. Log in to your RPi

      2. Edit file with sudo nano ~/RetroPie-Setup/scriptmodules/supplementary/mkarcadejoystick.sh

      3. Make these changes, note the ### and following line. (the version number may vary)

        function _version_mkarcadejoystick() {
        ###    echo "0.1.7"
            echo "0.1.7-hotkey"
        }
        
        function depends_mkarcadejoystick() {
            depends_gamecondriver
        }
        
        function sources_mkarcadejoystick() {
        ###    gitPullOrClone "$md_inst" https://github.com/cmitu/mk_arcade_joystick_rpi retropie
            gitPullOrClone "$md_inst" https://github.com/cmitu/mk_arcade_joystick_rpi retropie-hotkeybtn
            cp /home/pi/git/mk_arcade_joystick_rpi/*.c "$md_inst"
            pushd "$md_inst"
            sed -i "s/\$MKVERSION/$(_version_mkarcadejoystick)/" "$md_inst/dkms.conf"
            popd
        }
        
        

        This will use the branch retropie-hotkeybtn which uses 2x13 GPIO pins but is limited to two GPIO connected controllers.

      4. Remove possible leftovers from retropie branch which may make the script fail: sudo rm -rf /opt/retropie/supplementary/mkarcadejoystick

      Then run sudo ~/RetroPie-Setup/retropie_packages.sh mkarcadejoystick. Upon a successful build everything should be good to go (I am assuming proper wiring ;-) ). See also testing hints here

      NB: If you need more buttons (up to 16 per controller) and/or joystick panels you should stay on the retropie-branch and consider using one or more MCP23017 -- see [1] for details.

      Branches retropie-hotkeybtn and retropie confirmed to be working on RPI3 and RPI4.
      Should also work on RPI1, 2 and Zero. If anyone can report back on these devices, it will be greatly appreciated.

      Cheers

      [1] https://github.com/cmitu/mk_arcade_joystick_rpi#more-joysticks-case--mcp23017

      1 Reply Last reply Reply Quote 0
      • LolonoisL Lolonois referenced this topic on
      • 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.