Hint: Using 13 Buttons on GPIO
-
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.
-
Log in to your RPi
-
Edit file with
sudo nano ~/RetroPie-Setup/scriptmodules/supplementary/mkarcadejoystick.sh
-
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. -
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 hereNB: 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
andretropie
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
-
-
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.