nodemcu esp8266开发板
使用语言:micro python
问题:DHT11温湿度传感器,执行报错,无法读取温度和湿度:
我是按照这个示例操作的:https://docs.micropython.org/en/latest/esp8266/quickref.html#dht-driver
micro python代码:
import dht
import machine
import utime
d = dht.DHT11(machine.Pin(4))
utime.sleep(2)
d.measure()
print(d.temperature())
d.humidity()
报错:
Traceback (most recent call last):
File "main.py", line 26, in <module>
File "dht.py", line 23, in measure
OSError: [Errno 110] ETIMEDOUT