# imports
import machine
import math
import time
from machine import Pin
MEASUREMENT_COUNT=16
ADC_RANGE = float((math.pow(2, 16) - 1))


def main():
    #ldr config
    adc = machine.ADC(Pin(27))
    led=machine.Pin(28, machine.Pin.OUT)

    #ntc config
    BETA = 3950
    ntc = machine.ADC(Pin(26))
    while True:
        ldr_value=adc.read_u16()
        ntc_value=ntc.read_u16()
        print("ldr value: {}".format(ldr_value))
        time.sleep(1)
        if ldr_value>2000:
            led.value(1)
        else:
            led.value(0)
     
        total_value = 0
        for _ in range(MEASUREMENT_COUNT):
            total_value += ntc.read_u16()
            average_value = total_value // MEASUREMENT_COUNT
            temp = round(1 / (math.log(1 / (ADC_RANGE / average_value - 1)) / 3950 + 1.0 / 298.15) - 273.15, 1)
        print("Temperature: {:.2f} ℃".format(temp))

if __name__ == '__main__':
    main()
    

$abcdeabcde151015202530354045505560fghijfghij
$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT