树莓派论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 4626|回复: 0
收起左侧

[领取铜币] 求教 DHT22新手

[复制链接]
发表于 2021-1-27 12:18:50 | 显示全部楼层 |阅读模式
最近用树莓派4B 链接 DHT22读温湿度,但总是报错如下  这是怎么回事Python 3.7.3 (/usr/bin/python3)>>> %Run HVACDetectByDHT22.pyTraceback (most recent call last):  File "/home/pi/Adafruit_Python_DHT/HVACDetectByDHT22.py", line 4, in <module>    humidity,temperature=Adafruit_DHT.read_retry(Adafruit_DHT.DHT22,pin)  File "/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py", line 94, in read_retry    humidity, temperature = read(sensor, pin, platform)  File "/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py", line 80, in read    platform = get_platform()  File "/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py", line 55, in get_platform    from . import Raspberry_Pi_2  File "/home/pi/Adafruit_Python_DHT/Adafruit_DHT/Raspberry_Pi_2.py", line 22, in <module>    from . import Raspberry_Pi_2_Driver as driverImportError: cannot import name 'Raspberry_Pi_2_Driver' from 'Adafruit_DHT' (/home/pi/Adafruit_Python_DHT/Adafruit_DHT/__init__.py)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|树莓派论坛 ( 粤ICP备15075382号-1  

GMT+8, 2024-10-31 13:31 , Processed in 1.250000 second(s), 25 queries , Gzip On.

Powered by Shumeipai.net! X3.2

© 2001-2015 树莓派论坛安全联盟

快速回复 返回顶部 返回列表