mholgatem / GPIOnext

The next evolution of GPioneer! Create virtual gamepads with your GPIO pins!
MIT License
134 stars 37 forks source link

Buttons effectively 'sticking' on - not detecting signal change #84

Open DCotterill opened 10 months ago

DCotterill commented 10 months ago

I have a Ras 3 Model B and the latest version of GPIONext installed (and EmulationStation, but probably not relevant).

Everything 'works', but the buttons intermittently stick on after being pressed.

I've tested this with 'gpionext test' and have the same outcome. It's not a physical button problem as it also occurs when I take of the button connector cables and just connect / disconnect them. Disconnecting sometimes sticks 'on', and a reconnect / disconnect resets it.

It's not a specific GPIO pin, as it randomly happens with all buttons / pins.

I also tried increasing the debounce to 50 and 100.

Any help would be appreciated - many thanks. Happy to provide lots more info if you think it would help diagnose.

mholgatem commented 6 months ago

Sorry about the delay in response. If upping the debounce did not work, my first guess would be noise in the lines. You can try adding a 10k resistor in line with your ground. You could also try gpionext set pulldown true in order to pulldown your pins. This would require you moving your ground line to the 5v line (so that button presses effectively pull each pin up to 5v in order to signal a button press).

The only other thing that I can think of at the moment is make sure that you are running your pi with a fast (& quality) sd card. as that can sometimes have strange effects.