Homepage Forums RetroPie Project GPIO Adapter, ControlBlock etc. Simple 1 button GPIO on off switch: 1 switch, 2 wires, 10 lines of code Reply To: Simple 1 button GPIO on off switch: 1 switch, 2 wires, 10 lines of code

#95934
kiwijam777
Participant

what version of RPI are you using? I have used the code above in its exact form on RPI2 and RPI B+, I have used it on the latest beta version of retropie and a 6 month old version of retropie. In all cases, I used the code as stated above and it worked, quotes and all. Also in all cases rc.local had to have the ampersand at the end or the pi would never fully boot because it would be stuck waiting for the shutdown command. I needed rc.local to be exactly:
sudo /home/pi/scripts/shutdown.sh &