from machine import Pin
import time
# Set up the LED pin
led = Pin(15, Pin.OUT)
# Set up the PIR sensor pin
pir = Pin(14, Pin.IN)
while True:
if pir.value() == 1: # Motion detected
led.value(1) # Turn the LED on
print("velgindhi")
else: # No motion
led.value(0)
print("velgakle")
# Turn the LED off
time.sleep(0.1) # Small delay to reduce CPU usage