from machine import Pin
import time
LED_PIN = Pin(0, Pin.OUT)
LDR_PIN = Pin(27, Pin.IN)
try:
while True:
ldr_value = LDR_PIN.value()
print(f"LDR Digital Value: {ldr_value}")
if ldr_value == 0:
LED_PIN.high()
else:
LED_PIN.low()
time.sleep(0.2)
except KeyboardInterrupt:
Pin.cleanup()