Reply To: Simple 1 button GPIO on off switch: 1 switch, 2 wires, 10 lines of code

Welcome Page 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

#122117
Profile photo of kiwijam777
kiwijam777
Participant

Sorry about the misspell in RC.local. I have mine named something sightly different so I made a quick edit before I copied it over. Again, my apologies.

With the switch you have to hold it down in order for it to turn off or on. I set the timing to 0 so it would be the quickest possible. Are you holding it down or just pressing it?

And this is for a momentary switch by the way that could also be your problem. I have another version I use for a toggle on and off switch.

Skip to toolbar