查询了无数中文资料,测试了N个代码,没有一个能成功读出数据。
甚至怀疑淘宝来的DHT11是坏的。在网上没有找到检测DHT11好坏的中文资料。有谁知道了,告诉我一声。
最终没办法,只有查英文资料,功夫不负有心人,找到一篇2012年发表的资料:
http://www.rpiblog.com/2012/11/interfacing-temperature-and-humidity.html
直接COPY & PASTE 。
用嘴吹DHT11,数据也有变化,说明测试是成功的。
Humidity = 36.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 36.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Invalid Data!!
Invalid Data!!
Humidity = 36.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 35.0 % Temperature = 26.0 *C (78.8 *F)
Humidity = 39.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 36.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 38.0 % Temperature = 26.0 *C (78.8 *F)
Humidity = 40.0 % Temperature = 27.0 *C (80.6 *F)
Humidity = 42.0 % Temperature = 27.0 *C (80.6 *F)
Humidity = 43.0 % Temperature = 27.0 *C (80.6 *F)
Humidity = 44.0 % Temperature = 28.0 *C (82.4 *F)
阅读(1995) | 评论(0) | 转发(0) |