Skip to content

Updating refresh rate #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MaderDash
Copy link

I have made modifications to the files DHT.cpp and DHT.h. The objective is to enable the DHT11 sensor to refresh at its designated refresh rate and to allow the setup to determine whether the user is utilizing a DHT11 or a different sensor.

I have verified its functionality on my end, but it would be beneficial if @cryptoAlgorithm could test it for additional confirmation.

@cryptoAlgorithm
Copy link

Ref #206

This block is responsible for enforcing the minimum read interval:

DHT-sensor-library/DHT.cpp

Lines 232 to 238 in 2295fe4

// Check if sensor was read less than two seconds ago and return early
// to use last reading.
uint32_t currenttime = millis();
if (!force && ((currenttime - _lastreadtime) < MIN_INTERVAL)) {
return _lastresult; // return last correct measurement
}
_lastreadtime = currenttime;

Specifically, note that the condition at L235 references the hardcoded MIN_INTERVAL definition.

Although you've introduced a new _minInterval property, it's not used anywhere else. The incorrect condition is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants