- Sun Sep 06, 2015 3:07 pm
#27959
I had that problem, the Adafruit script, as is, does not work with the DHT21. There is an updated script that worked for me, however I am away from home and do not have access to it. I think it involved instancing the DHT is a third parameter.
I have looked but cannot locate the file. In the Adafruit DHT-sensor-lib on github the example code contains this statement:-
// Initialize DHT sensor.
// Note that older versions of this library took an optional third parameter to
// tweak the timings for faster processors. This parameter is no longer needed
// as the current DHT reading algorithm adjusts itself to work on faster procs.
If I remember correctly I used this to instance the DHT :-
DHT dht(DHTPIN, DHTTYPE, 30);
Also ensure that you have the DHT defined as the device in use.
Hope this has helped. Good Luck