from machine import ADC
import time
# Initialize ADC for the analog pin
light_sensor = ADC(34) # Replace '0' with the correct ADC channel for your board
power = ADC(36) # Replace '0' with the correct ADC channel for your board
while True:
light_level = light_sensor.read_u16() # Reads a 16-bit value (0-65535)
print("Light level:", light_level)
time.sleep(1)
powerin = power.read_u16() # Reads a 16-bit value (0-65535)
print("Light level:", powerin)
time.sleep(1)