import utime, random,dht
from machine import Pin,ADC
#button = ADC(Pin(26)) # create ADC object on ADC pin
led = Pin(25, machine.Pin.OUT)
pin = machine.Pin(28, machine.Pin.OUT, machine.Pin.PULL_DOWN)
sensor = dht.DHT11(pin)
utime.sleep(1)
while True:
print("温度:{} ℃ 湿度:{} %".format(sensor.temperature, sensor.humidity))
utime.sleep(5)