SNES / SFC original reset button to exit emulator GPIO
I have nearly completed a SNES build using a Pi Zero, i have both the original controllers working and the original power switch.
What i need to finish is to set up the original reset button to exit the emulator and go back to the game select menu. i have read several threads but again there is a lot of conflicting info.
I have the original switch wired up and going to GPIO pin 17 and a GND pin but im a little lost after this.
Can anyone help me get this setup correctly.?
I believe i have the hardware side ok, i am just finding the software script difficult when the switch is pressed and to exit the emulator.
with the following code below working off GPIO pin 5, this will initiate a shutdown when the button is pressed. but what do i need to change "shutdown -h now" to, for it to exit the current emulator.
on the controller it is "start + select" and on an unplugged keyboard it is "space + enter". do i just add that ? or is there any specific syntax?
import RPi.GPIO as GPIO
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)
oldButtonState1 = True
buttonState1 = GPIO.input(5)
if buttonState1 != oldButtonState1 and buttonState1 == False:
subprocess.call("shutdown -h now", shell=True,
oldButtonState1 = buttonState1
can anybody help?
i know it is possible i just dont know the correct syntax to trigger the emulator exit in the script.
I managed to sort it out on my own.
Maybe due to the wiring of the button
Capeman last edited by Capeman
If you don't want to futz with code and gpio pins...
The easiest way i've found to use buttons on an original console is to rip apart an old usb keyboard (thrift store finds are the best), jumper test the matrix until you find the escape key, and solder the 2 pins from the reset buttons to the keyboard PCB so the reset button presses ESC (which in retropile will exit ANY emulator). Then just plug keyboard PCB into a spare usb slot. No code, not hassle.
I did this on the buttons on my atari build (though i didnt use original buttons, a momentary switch is a momentary switch regardless of the shape). See the atari link in my sig.
@Capeman nice idea man. that would save a lot of headaches.
I managed to get it working in the end. i believe i had the GPIO pull_up_down the wrong way around.
@CeEeeEe4 Hey man any chance u could share your reset button python code? I have exactly the same prob. My shutdown code works flawlessly, just need the exit emulator button. thanks bro
Can somegive tell me which PINs to use from the original SNES Reset button, so I can solder 2 wires and connect one to GPIO17 and the other one to GND of the Raspberry?
I don't know which one is which one and am unsure if the picture is correct or not.