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

    gpio and retropie connection problem

    Scheduled Pinned Locked Moved Help and Support
    retropie 4.8raspberry 3btft screengpio 26 pingame boy
    4 Posts 2 Posters 401 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.
    • T
      thibab
      last edited by

      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!

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

        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.

        T 1 Reply Last reply Reply Quote 0
        • T
          thibab @mitu
          last edited by

          @mitu ok thanks for the answer i had already tried with RetroGame but not GPioneer. i'll give it a try!

          T 1 Reply Last reply Reply Quote 0
          • T
            thibab @thibab
            last edited by

            it's working! fantastic! thanks!

            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.