# mPy - kit FKS0001 LDR exercise printing light intensity @ 5 Hz.
# copyright by Anthony Vogelaar, Perth Scotland
# rev 0.10  2025-04-23  initial release

# https://docs.micropython.org/en/latest/esp32/quickref.html

import	time
from	machine		import	ADC

# ==================== hardware =========================

ldr	= ADC(35, atten=ADC.ATTN_11DB)		# 0.15 .. 2.45V

# ====================== main ===========================

# print LDR value @ 5 Hz. Use also View | Plotter
def main():
    while True:
        print(ldr.read())					# for usage with View | Plotter
#        print(f'{ldr.read():5}', end='')	# compact presentation in shell
        time.sleep_ms(200)
        
        
main()

# ======================= end ===========================
