from machine import Pin,ADC
from utime import sleep
photPIN = 28
def readLight(photoGP):
photoRes = ADC(Pin(28))
light = photoRes.read_u16()
light = round(light/65535*100,2)
return light
while True:
print("light: " + str(readLight(photPIN)) + "%")
sleep(1)