Exit roms via GPIO
-
Seems highly possible and that is a great idea. I am working on a similar project, I even put a hard drive into an old cart.
You're onto something. I know the gpio pins can be set to listen to specific events. I am not sure if you can write a script to send a keypress upon event, but that may work.
I will post back if I find anything else. Also following because I would like to do the same.
EDIT::
I found this:
https://www.reddit.com/r/RetroPie/comments/5elv5e/using_original_nes_powerreset_buttons/It seems like you would use the script to press your hotkey button combination using GPIO.
This one is about a custom case (retroflag) but the process would be similar.
https://www.reddit.com/r/RetroPie/comments/adty12/how_to_bind_reset_button_from_retroflag_case_to/ -
@_DamnIt You can wire up @cyperghost's shutdown/poweroff script to the GPIO button press, calling the script with the
--closeemu
argument, this will exit any emulator started from Emulationstation/Runcommand. -
This post is deleted! -
This is super! But unfortunately, I forgot to tell you that I have no idea what I'm doing. First time trying script, and my other programming on this, was done with copy/paste.
Is there a very clear guide anywhere whit what I should type in?
Thanks!
-
I did it with a Zero Delay USB Encoder changing /opt/retropie/configs/all/retroarch/autoconfig/Microntek USB Joystick.cfg values to set specific functions to each button
input_device = "Microntek USB Joystick "
input_driver = "udev"
input_l_btn = "5"
input_load_state_btn = "10"
input_start_btn = "6"
input_exit_emulator_btn = "8"
input_down_axis = "+1"
input_r_btn = "4"
input_save_state_btn = "11"
input_right_axis = "+0"
input_state_slot_increase_axis = "+0"
input_select_btn = "7"
input_left_axis = "-0"
input_state_slot_decrease_axis = "-0"
input_l2_btn = "9"
input_up_axis = "-1"
input_a_btn = "0"
input_b_btn = "1"
input_reset_btn = "9"
input_r2_btn = "8"
input_x_btn = "2"
input_menu_toggle_btn = ""
input_y_btn = "3"and deleting the line with:
input_enable_hotkey_btn =I don't know if it's possible via GPIO
-
@_DamnIt said in Exit roms via GPIO:
in an old NES-consul. I have made the power button turn on and off the pie, made the LED light work, but now i´m trying to make the reset button exit roms.
I have googled and checked YT, and searched the forum, but didn´t find anything that really seemed to handle my issue.
To eliminate any risk of misunderstanding, I´m trying to get the physical resetMy suggestion is that you install crcerror's shutdown script, which supports both a Power and smart Reset button. You will almost certainly need to uninstall whatever shutdown script you previously used.
Pressing Reset while an emulator is running will exit the emulator; pressing it in Emulation Station will restart ES. The script is intended for use with RetroFlag cases, however it just uses standard GPIO pin assignments so can be used with any Raspberry Pi. I recently installed the script on my Pi Zero. While I had to do a few tweaks, it works just fine on a Pi. The only downside to using it is that it uses an extra GPIO pin as a feedback pin for the GPI cases to tell them to cut power to the Pi completely (this is a special function of the RetroFlag cases).
crcerror's shutdown script uses the following pin assignments which you can attached a standard momentary button for power & reset and a resistor & LED for power lamp.
GPIO 2 (Pin 3) for Reset
GPIO 3 (Pin 5) for Power
GPIO 4 (Pin 7) for Shutdown feedback
GPIO 14 (pin 8) for LED control (note, you shouldn't connect an LED directly to a GPIO, best method is to use a resistor to protect the GPIO from damage).
Those pin assignments can be reassigned by editing the following file:/opt/RetroFlag/SafeShutdown.py
-
@ericbsmith42 said in Exit roms via GPIO:
@_DamnIt said in Exit roms via GPIO:
in an old NES-consul. I have made the power button turn on and off the pie, made the LED light work, but now i´m trying to make the reset button exit roms.
I have googled and checked YT, and searched the forum, but didn´t find anything that really seemed to handle my issue.
To eliminate any risk of misunderstanding, I´m trying to get the physical resetMy suggestion is that you install crcerror's shutdown script, which supports both a Power and smart Reset button. You will almost certainly need to uninstall whatever shutdown script you previously used.
Pressing Reset while an emulator is running will exit the emulator; pressing it in Emulation Station will restart ES. The script is intended for use with RetroFlag cases, however it just uses standard GPIO pin assignments so can be used with any Raspberry Pi. I recently installed the script on my Pi Zero. While I had to do a few tweaks, it works just fine on a Pi. The only downside to using it is that it uses an extra GPIO pin as a feedback pin for the GPI cases to tell them to cut power to the Pi completely (this is a special function of the RetroFlag cases).
crcerror's shutdown script uses the following pin assignments which you can attached a standard momentary button for power & reset and a resistor & LED for power lamp.
GPIO 2 (Pin 3) for Reset
GPIO 3 (Pin 5) for Power
GPIO 4 (Pin 7) for Shutdown feedback
GPIO 14 (pin 8) for LED control (note, you shouldn't connect an LED directly to a GPIO, best method is to use a resistor to protect the GPIO from damage).
Those pin assignments can be reassigned by editing the following file:/opt/RetroFlag/SafeShutdown.py
What kind of resistor?
Not sure if i could make it work, have absolutly no idea of what i´m doing. Total beginner on this. :)
-
@_DamnIt Use http://ledcalc.com/ to calculate resistor value according used LED. There is no need for a 100% hit in resistor value but use one to avoid burn out of LED.
The Pi uses 3.3 for GPIO output.
Standard USB output is 5.0V -
@_DamnIt I actually did this with my NES project. If you follow the link in my signature, there's a section on me creating the script and all that jazz. It did work fine, till I re-imaged my Pi with newer Retropie and don't set it back up (I found I hardly used the button to exit games, it meant I had to get up rather than use the wireless controller hotkeys).
There's basically 2 scripts, one a python script and another a shell script. You set the shell script to call the python script at boot and it monitors the defined gpio pins for input. Once it gets them, it sends an escape press which exits the game.
-
I put an exit game button on Gpio in my atari console build by simply installing Adafruit’s retrogame application on my Pi, which makes the gpio able to take keyboard inputs, then I just set one of the pins to activate the escape key.
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.