You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cause is simple, your timing jitters. The cure is difficult.
The code is more or less a foundation on which to build further.
For example, no threading is used. In practice, all processes run simultaneously parallel to the DHT22 code and can influence the timing. As can be found in the documentation, timing needs to be quite precise.
You can address the issue from two sides.
Try to get the timing as accurate as possible.
Fix the outcome. Most errors are so obvious (>100% humidity) or have a completely different outcome compared to the previous one (temperature dropping from 25° to 0° between readings) that you already know they are erroneous values.
When compiling and running your program with g++
the output looks like
Note
I've been reformatting the output a bit and changing the loop delay to 5000ms in
main.cpp
.We can see zero values and sporadic doubled temperature values and +100 humidity values.
Why is that?
The text was updated successfully, but these errors were encountered: