DHT11 Adafruit库:此参数是否必要? [英] DHT11 Adafruit Library: Is this parameter necessary?

查看:146
本文介绍了DHT11 Adafruit库:此参数是否必要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅: 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?

推荐答案

该变量在任何时候到底是如何被利用?

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.

此参数是否必要?

Is this parameter necessary?

大概是为了保持二进制稳定性而对接口进行了维护.

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库:此参数是否必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆