Raspberry Pi - gpiozero Library
What will be printed by this Python code when the PIR sensor detects motion?
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.IN)
if GPIO.input(4):
print("Motion detected!")
else:
print("No motion")