Raspberry Pi - LED and Button Projects
What will be printed by this code if the button connected to GPIO 20 is NOT pressed?
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
if GPIO.input(20) == 0:
print("Pressed")
else:
print("Not Pressed")
