# Digital sensor data
# Reading and showing the output of a PIR motion sensor
# Connect the PIR motion sensor to the Pico
# Vcc connects to power (either 3.3V or 5V for this sensor)
# Out connects to pin GP28
# GND connects to any ground pin on the Pico
# Use the code provided or create your own
from machine import Pin
from time import sleep_us
led=Pin(0,Pin.OUT)
switch=Pin(28,Pin.IN)
led.off()
while True:
is_switch_off=switch.value()
if is_switch_off:
led.on()
else:
led.off()