请参阅:https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.h
在DHT.H中,构造函数初始化参数count = 6
DHT(uint8_t pin, uint8_t type, uint8_t count=6);
在DHT.cpp中,我没有看到任何地方使用的变量。它只提到:
// Note that count is now ignored as the DHT reading algorithm
// adjusts itself base on the speed of the processor.
_maxcycles = microsecondsToClockCycles(1000);
这个变量到底是如何被利用的?
答案 0 :(得分:0)
这个变量到底是如何[被利用]的?
不是。
它被忽略了,因为DHT读取算法根据处理器的速度调整自己的基础 [sic] 。"
我们可以在this commit中看到,在以前版本的代码中,情况并非如此。
这个参数是否必要?
据推测,界面已经保持二进制稳定性。
这是完全正常和良好的。如果头文件有任何有用的文档注释,他们会指出count
现在是残留的。