DHT11 Adafruit 库:这个参数有必要吗? [英] DHT11 Adafruit Library: Is this parameter necessary?

查看:31
本文介绍了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 读取算法会根据处理器的速度自行调整[原文如此]."

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

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