I’ve had this problem for a while and I’m not sure how to fix it.
I’m using MMM-Buttons to switch between scenes from MMM-Scenes and it’s working. However, it only works if I first use a little python test program I have to test the buttons. Why? I don’t even have to actually press a button, just run the python and then exit. After that, the buttons work.
I thought I posted this before but can’t find it. I apologize if this is a duplicate.
Python:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
input_state25 = GPIO.input(25)
input_state24 = GPIO.input(24)
if input_state25 == False:
print('Button Pressed 25')
time.sleep(0.2)
if input_state24 == False:
print('Button Pressed 24')
time.sleep(0.2)