from machine import Pin, ADC, PWM, UART
from time import sleep

sensor_od = ADC(Pin(28))
sensor_do = PWM(Pin(27))

led = Pin(0, Pin.OUT)
move_capt = Pin(26, Pin.IN)

while True:
  lum_od = sensor_od.read_u16()
  print(str(lum_od))
  sleep(0.3)

  move = move_capt.value()
  print(move)

  # 65007-512 activer à 35000 lux
  if lum_od < 35001 and move == True:
    led.value(1)
    sleep(5)
  if lum_od > 35000 and move == True:
    led.value(0)
    print("Présence détectée")
    sleep(5)
  
  led.value(0)


BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT