from machine import Pin
import time, dht
data = dht.DHT22(Pin(4)) # 实例化15号管脚
while True:
data.measure() # 先调用测量函数,获取温湿度
temp=data.temperature()
humi=data.humidity()
print(temp, humi)
time.sleep(1)
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1