Raspberry Pi - LED and Button Projects
What is wrong with this code snippet for detecting a button press on GPIO 12?
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(12, GPIO.OUT, pull_up_down=GPIO.PUD_UP)
if GPIO.input(12) == 0:
print("Pressed")
