Closed yeeking closed 5 years ago
Thanks for the report. This looks like it's the exact same problem as in #411. I'm already debugging it and I'm trying to see where this comes from.
@yeeking in the first case, were NaNs the only thing you were seeing? If not, have you considered reading the DHT sensor until you'd get valid data and then repeat the process?
What I have noticed is that the DHT sensor cannot be read too fast. When that happens, you get NaNs as a response - it's in the library of the sensor actually. So that's why it would be a probably good idea to run a loop with a sleep in it until you get valid data.
I am testing the temp and humidity sensor that comes with the starter kit (the blue one).
The example code in the projects folder gives back nans. Here is the minimum code that produces the error, where the temp is printed once but not again:
This is the output
However, I discovered that this does work:
This is the output: