Class for DHT11, DHT21 and DHT22 (temperature & humidity)

[quote author=Mark Ruys link=topic=58531.msg1274792#msg1274792 date=1370985148]

  • 800usec for a DHT22 is according to the datasheets I found. And it works.
    [/quote]Nice. Will try with the current lib I'm using!
  • My library won't hang. The endless loop you mention has a return statement which is called after 85 usec.
  • Per DHT instance, you need 18 bytes of data~~, perhaps a little more overhead, I would need to measure to give a hard number~~. So no problem to run a lot of DHT sensors (tried two myself). The advantage of having an instance per sensor is that you can read out them in parallel. On the other hand, it would be straightforward to alter setup() to something like setup(pin, model) and then you could reuse the instance. But not sure if the effort is worth the 18*(sensor-1) bytes...

Ah! You are right, I misread some of the C++ code :zipper_mouth_face:
18 bytes is not very much indeed. Thanx!