问题描述
请参阅: https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.h
在DHT.H中,构造函数初始化参数count = 6
In DHT.H the constructor initializes the parameter count=6
DHT(uint8_t pin, uint8_t type, uint8_t count=6);
在DHT.cpp中,我看不到任何地方使用的变量.它只提到:
In DHT.cpp I don't see the variable used anywhere. It only mentions:
// Note that count is now ignored as the DHT reading algorithm
// adjusts itself base on the speed of the processor.
_maxcycles = microsecondsToClockCycles(1000);
这个变量在任何时候都被利用了吗?
How exactly is this variable being utilized at any moment?
推荐答案
不是.
它被忽略,因为DHT读取算法会根据处理器的速度自行调整 [sic] ."
It's "ignored as the DHT reading algorithm adjusts itself base [sic] on the speed of the processor."
我们可以在此提交中看到,这不是以前版本的代码中的大小写.
We can see in this commit that this wasn't the case in a previous version of the code.
大概是为了保持二进制稳定性而对接口进行了维护.
Presumably the interface has been maintained for binary stability.
这是完全正常和良好的.如果头文件中有任何有用的文档注释,它们会指出count
现在是残留的.
This is perfectly normal and good. If the header file had any useful documenting comments they would point out that count
is now vestigial.
这篇关于DHT11 Adafruit库:此参数是否必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!