6464| 3
|
[已解决] SHT1x温湿度传感器提供的库文件中的例程无法通过编译 |
我购买了一个SHT1x温湿度传感器,从DFRobot产品网页上(https://www.dfrobot.com.cn/index.php?route=product/product&filter_name=SHT1x&product_id=114)下载了库文件(http://www.dfrobot.com/image/data/DFR0066/SHT1x_Arduino.zip),解压后存放在Arduino安装目录下(D:\arduino-1.0.4\libraries),然后调用例程:D:\arduino-1.0.4\libraries\SHT1x\examples\ReadSHT1xValues,编译时失败,出现如下提示: In file included from ReadSHT1xValues.pde:11: D:\arduino-1.0.4\libraries\SHT1x/SHT1x.h:15:22: error: WProgram.h: No such file or directory In file included from ReadSHT1xValues.pde:16: D:\arduino-1.0.4\hardware\arduino\cores\arduino/Arduino.h:111: error: expected ',' or '...' before numeric constant D:\arduino-1.0.4\hardware\arduino\cores\arduino/Arduino.h:112: error: expected ',' or '...' before numeric constant 请问这是什么原因?如何解决? 多谢! |
多谢提供新的库文件。 可是,我使用新的库文件和其附带的例程,虽然可以编译了,却得到如下运行结果: Starting up Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.44% Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.44% Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.44% Temperature: -40.0099983215C / -40.0180015563F. Humidity: -4.44% 这样的结果明显和实际情况不符。 请帮忙看看有什么问题,多谢! 例程如下: 电路连接按照产品库中的图例连接的。 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed