adafruit_dhtlib

CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.

  • Author(s): Mike McWethy

Hardware:

Software and Dependencies:

class adafruit_dht.DHT11(pin, use_pulseio=True)[source]

Support for DHT11 device.

Parameters:pin (Pin) – digital pin used for communication
class adafruit_dht.DHT22(pin, use_pulseio=True)[source]

Support for DHT22 device.

Parameters:pin (Pin) – digital pin used for communication
class adafruit_dht.DHTBase(dht11, pin, trig_wait, use_pulseio)[source]

base support for DHT11 and DHT22 devices

exit()[source]

Cleans up the PulseIn process. Must be called explicitly

humidity

humidity current reading. It makes sure a reading is available

Raises RuntimeError exception for checksum failure and for insufficient data returned from the device (try again)

measure()[source]

measure runs the communications to the DHT11/22 type device. if successful, the class properties temperature and humidity will return the reading returned from the device.

Raises RuntimeError exception for checksum failure and for insufficient data returned from the device (try again)

temperature

temperature current reading. It makes sure a reading is available

Raises RuntimeError exception for checksum failure and for insufficient data returned from the device (try again)