Raspberry Pi - LED and Button Projects
Identify the error in this code snippet for detecting a button press on GPIO 5:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(5, GPIO.IN)
if GPIO.input(5) == True:
print("Button Pressed")
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions