moode-player / moode

moOde sources and configs
GNU General Public License v3.0
963 stars 163 forks source link

Check for valid edges in gpio_buttons.py #663

Open ralphcrutzen opened 1 month ago

ralphcrutzen commented 1 month ago

I have a button (connected to GPIO 16, set up as pull down) which works in my own test program, but did not respond when I set it up on the GPIO Control page in MoOde. I got the button to work by removing the condition on line 58 of /var/www/daemon/gpio_buttons.py:

if GPIO.input(channel) == 1: # Only deal with valid edges

So I wonder if this condition is really necessary.

moodeaudio commented 1 month ago

Thats a good question. I don't have any experience with GPIO but IIRC that condition was recommended by one of our users to help reduce bounce (I think).