print("This device will detect motion")
print("22/11/2023")
print("created by ZUNIE")
#import libraries
from machine import Pin
from utime import sleep
#Pin declaration
red_LED = Pin(2, Pin.OUT)
sensor_motion = Pin(12, Pin.IN)
while True:
status_intruder = sensor_motion.value()
if status_intruder == 1:
print("There is INTRUDER!!!! HELPPPPPP!!!!!")
for a in range (5):
red_LED.on()
sleep(0.5)
red_LED.off()
sleep(0.5)
else:
print("SANTAIII BRO MASIH BIASA")
red_LED.off()
status_intruder = 0
sleep(2)