gpio and retropie connection problem
-
Hello,
I'm new to RetroPie, and I've been trying to transform it into a Game Boy using a Raspberry Pi 3B and RetroPie 4.8. I'm using a 2.8" screen for gaming. I've encountered an issue: I followed this guide (https://learn.adafruit.com/pigrrl-raspberry-pi-gameboy/wiring-buttons) to add buttons similar to those on a Game Boy. After soldering the cables to the PCB parts and connecting the GPIO cable to the TFT screen I can't configure the buttons when I launch RetroPie (they are not detected).
I created a Python program to test if the buttons were soldered correctly, and they seem fine:
import RPi.GPIO as GPIO import time # pins GPIO BUTTON_PINS = [2, 3, 4, 17, 27, 22, 10, 9, 11, 5, 6, 13, 19, 26, 14, 15, 18, 23, 24, 25, 8, 7, 12, 16, 20, 21] # Config pins GPIO.setmode(GPIO.BCM) for pin in BUTTON_PINS: GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) try: print("test start. CTRL+C to quit.") while True: for pin in BUTTON_PINS: if not GPIO.input(pin): print(f"The button connected to GPIO {pin} has been pressed.") time.sleep(0.1) except KeyboardInterrupt: print("Test end") finally: GPIO.cleanup()
So, the problem seems to be related to RetroPie, but I'm not sure how to resolve it. Any help would be greatly appreciated. Thanks!
-
There has to be some software the interprets the GPIO inputs and transforms them into an input device (gamepad/keyboard) to be recognized by RetroPie/emulators.
In the documentation from Adafruit, the Software page has a separate installation image with RetroPie which probably includes the software that creates the input device(s) - the CupCade image.Since you're starting with RetroPie only, you need to install that mapping software. You can use something like GPioneer or Adafruit RetroGame in order to create and configure an input device from the GPIO pings.
-
@mitu ok thanks for the answer i had already tried with RetroGame but not GPioneer. i'll give it a try!
-
it's working! fantastic! thanks!
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.