与 DHT11 传感器集成时 arduino IDE 中的编译错误

与 DHT11 传感器集成时 arduino IDE 中的编译错误

我已经添加了DHT11库,但编译时仍然出现下面提到的错误。请帮我解决这个问题。提前谢谢

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"In file included from C:\Users\lenovo\Documents\libraries\DHT_sensor_library\DHT_U.cpp:15:0:
C:\Users\lenovo\Documents\libraries\DHT_sensor_library\DHT_U.h:36:29: fatal error: Adafruit_Sensor.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno. This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
?

答案1

您还需要“Adafruit Unified Sensor”库。在库管理器中搜索并安装。您应该一切顺利。

相关内容