Raspberry Pi - gpiozero Library
Find the bug in this PIR sensor code snippet:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
if GPIO.input(21):
print("Motion detected")Find the bug in this PIR sensor code snippet:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
if GPIO.input(21):
print("Motion detected")15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions