Raspberry Pi - LED and Button Projects
Identify the error in this Raspberry Pi button press detection code:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
if GPIO.input(23) == GPIO.HIGH:
print("Button Pressed")
time.sleep(0.1)
