首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Raspberrypi的DHT20存在的问题

使用Raspberrypi的DHT20存在的问题
EN

Stack Overflow用户
提问于 2022-09-04 17:51:52
回答 1查看 309关注 0票数 1

我对覆盆子皮皮科很陌生

我一直在用micropython编写我的Pico程序,以使用DHT20温湿度传感器,使用seeedwiki中给出的库,我无法使用他们给我的代码,如下所示:

代码语言:javascript
复制
from machine import I2C
from dht20 import DHT20
i2c = I2C(0)
dht20 = DHT20(i2c)
while True:
    temper = dht20.dht20_temperature()
    humidity = dht20.dht20_humidity()
    print("temper : " + str(temper))
    print("humidity : " + str(humidity))

使用上面的代码和dht20自由主义导致这个错误。

代码语言:javascript
复制
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "dht20.py", line 6, in __init__
  File "dht20.py", line 25, in dht20_read_status
OSError: [Errno 5] EIO

dht20库可以在以下文件中找到:Grove-温湿度传感器V2.0(DHT20)

EN

回答 1

Stack Overflow用户

发布于 2022-10-25 16:05:29

看看https://github.com/flrrth/pico-dht20

它起作用了。用于MicroPython +示例的DHT20模块

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73601604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档