请参阅: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);这个变量在任何时候都是如何使用的?
发布于 2016-03-14 18:29:41
这个变量在任何时候都是如何使用的?
事实并非如此。
它“被忽略了,因为DHT读取算法根据处理器的速度调整自己。”
我们可以在此承诺中看到,在以前版本的代码中,情况并非如此。
这个参数有必要吗?
据推测,为了实现二进制稳定性,该接口已经得到维护。
这是完全正常和好的。如果头文件有任何有用的文档注释,他们会指出,count现在是残余物。
https://stackoverflow.com/questions/35995195
复制相似问题