from machine import Pin,ADC
import time
relay=Pin(7,Pin.OUT)
LDR=ADC(28)
relay.low()
conversion_factor=3.3/(65536)
while True:
val=LDR.read_u16()
relay.value(val)
print("ON")
print("LDR:",val*conversion_factor)
time.sleep(1)
relay.value(0.8058151)
print("OFF")
time.sleep(2)