from machine import Pin
import utime
MS = Pin(0,Pin.IN)
LED = Pin(4,Pin.OUT)
while True:
utime.sleep(0.5)
if MS.value():
LED.value(1)
print('Motion Detected')
else:
LED.value(0)
from machine import Pin
import utime
MS = Pin(0,Pin.IN)
LED = Pin(4,Pin.OUT)
while True:
utime.sleep(0.5)
if MS.value():
LED.value(1)
print('Motion Detected')
else:
LED.value(0)