Sega Genesis Classic UPDATE How to make power button functional
How to wire a working power button for the Sega Genesis Classic Mini with Retropie. This guide shows how to install switch and modify led but you will also have to modify the script on your Raspberry Pi with Retropie installed.............................................. Here is a link for similar momentary switches like mine http://www.ebay.com/sch/i.html?_odkw=jandorf+buzzer+momentary+push+button+switch+61306&_osacat=1249&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xjandorf+61306.TRS0&_nkw=jandorf+61306&_sacat=1249
..........................................................................................................
This is the commands you enter to change script on Retropie command prompt configuration.....also here is a link to ETA Prime's guide that explains this better..https://www.youtube.com/watch?v=4nTuzIY0i3k&t=7s..
ALSO A NOTE FOR LINE 5. the full address may not show on youtube. Here is the full address if needed don't forget to add http: to beginning though:
//pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz
VERSION 1.1
Enter the following commands in Retropie command prompt :
1. sudo apt-get install python-dev
2. sudo apt-get install python3-dev
3. sudo apt-get install gcc
4. sudo apt-get install python-pip
5. wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz
6. sudo tar -zxvf RPi.GPIO-0.5.11.tar.gz
7. cd RPi.GPIO-0.5.11
8. sudo python setup.py install
9. sudo python3 setup.py install
10. mkdir /home/pi/scripts
11. sudo nano /home/pi/scripts/shutdown.py
The content of the script: Paste it in the blank area
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import subprocess
# we will use the pin numbering to match the pins on the Pi, instead of the
# GPIO pin outs (makes it easier to keep track of things)
GPIO.setmode(GPIO.BOARD)
# use the same pin that is used for the reset button (one button to rule them all!)
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)
oldButtonState1 = True
while True:
#grab the current button state
buttonState1 = GPIO.input(5)
# check to see if button has been pushed
if buttonState1 != oldButtonState1 and buttonState1 == False:
subprocess.call("shutdown -h now", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
oldButtonState1 = buttonState1
time.sleep(.1)
11-2. Press CRTL X Then Y
12. sudo reboot
13. sudo nano /etc/rc.local
13-2. Now Add the following to the file:
sudo python /home/pi/scripts/shutdown.py &
13-3. then Press CRTL X Then Y ......................................................
Hackerland by Twin Musicom is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/by/4.0/)
Source: http://www.twinmusicom.org/song/292/hackerland
Artist: http://www.twinmusicom.org
Artist: http://incompetech.com/
8bit Dungeon Boss - Video Classica by Kevin MacLeod is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/by/4.0/)
Source: http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1200067
Artist: http://incompetech.com/