I'm trying to connect this Toggle Switch to my Pi
But I can't seem to get any input off it, It's connected to a GPIO pin and ground like I've done with Push Buttons in the past but it just doesn't work.
Any ideas?
I'm trying to connect this Toggle Switch to my Pi
But I can't seem to get any input off it, It's connected to a GPIO pin and ground like I've done with Push Buttons in the past but it just doesn't work.
Any ideas?
It seems I had an error in my GPIO setup, I had the wrong GPIO.PUD_UP set.
GPIO.setup(LG_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
Working fine with the code above now :)