Hello
I use the Adafruit DHT lib, because it has a nice feature of checking if there is coming data from the sensor, in that way I can check if the cable is broken og sensor is dead. (isnan)
The problem:
This lib is blocking. I had a little peek at DHT.CPP:
// Go into high impedence state to let pull-up raise data line level and
// start the reading process.
digitalWrite(_pin, HIGH);
delay(250);
I changed the delay to 50 instead. All seems to still work, and now it is not noticeable blocking rest of my code. I can read the sensor with a few cm of cable and tried adding a cable roll of 100 meters, it still work. Also tested with five different DHT 22 sensors
But, there must be a reason for the original delay of 250. Can anyone shed some light here ?
Best regards