-
Notifications
You must be signed in to change notification settings - Fork 3
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
fetchInterval seems to be broken for values < 1 #2
Comments
You're right, I cast the number to an integer in C++, and expect an unsigned integer in the scheduler. So putting any decimal number truncate it. Secondly the DHT22 can only be read every two seconds, that's why you may have error (because the checksum don't match), or even strange/corrupted data like 0°C. I think I should have added a way to check frequences based on a sensor to avoid that type of issue, I'll look into it. |
Given that you include a note about that in the README, you could also buffer the last reading and if a program attempts to read it again within too few time it just delivers the old result. |
Description
fetchInterval
pulls far more often than twice per second. Resulting data is corrupted. My guess is that you're using an integer for that, and only allow seconds. Then the program automatically rounds it down, to make it fit intoint
.My Code
Log output
Software
Hardware
Raspberry Pi 3
The text was updated successfully, but these errors were encountered: