GY-63_MS5611/libraries/DHTlib
2023-10-25 17:25:03 +02:00
..
.github 0.1.35 DHTlib + github actions 2023-02-18 20:46:51 +01:00
examples 0.1.35 DHTlib 2021-12-16 16:44:08 +01:00
test 2021-01-29 2021-01-29 12:31:58 +01:00
.arduino-ci.yml 0.1.34 DHTlib 2021-11-13 19:57:17 +01:00
CHANGELOG.md 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
dht.cpp 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
dht.h 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
keywords.txt 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
library.json 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
library.properties 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00
LICENSE 0.1.35 DHTlib + github actions 2023-02-18 20:46:51 +01:00
readme.md 0.1.36 DHTlib 2023-10-25 17:25:03 +02:00

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

DHTlib

Arduino library for DHT temperature and humidity sensor. AVR optimized

Description

The DHT11, 21, 22, 33 and 44 are relative inexpensive sensors for measuring temperature and humidity.

This library can be used for reading both values from these DHT sensors. The DHT11 only returns integers (e.g. 20) and does not support negative values. The others are quite similar and provide one decimal digit (e.g. 20.2) The hardware pins of the sensors and handshake are identical so ideal to combine in one lib.

The library (0.1.13 version) is confirmed to work on:

  • UNO (tested myself)
  • 2009 (tested myself)
  • MEGA2560
  • DUE
  • attiny85 @8MHz
  • Digistump Digix @ 84 MHz

Later 0.1.xx versions are optimized for AVR only.

More information - http://playground.arduino.cc/Main/DHTLib -

For latest version for the DHT, check https://github.com/RobTillaart/DHTNEW

DHT PIN layout from left to right

Front Description
pin 1 VCC
pin 2 DATA
pin 3 Not Connected
pin 4 GND

Interface

#include "dht.h"

Constructor

  • dht() Constructor

Read functions per type

  • int8_t read11(uint8_t pin)

  • int8_t read(uint8_t pin)

  • int8_t read12(uint8_t pin)

  • inline int8_t read21(uint8_t pin)

  • inline int8_t read22(uint8_t pin)

  • inline int8_t read33(uint8_t pin)

  • inline int8_t read44(uint8_t pin)

  • inline int8_t read2301(uint8_t pin)

  • inline int8_t read2302(uint8_t pin)

  • inline int8_t read2303(uint8_t pin)

  • inline int8_t read2320(uint8_t pin)

  • inline int8_t read2322(uint8_t pin)

  • float humidity public class variable to access last read humidity.

  • float temperature public class variable to access last read temperature.

Enable / disable interrupts

  • bool getDisableIRQ()
  • void setDisableIRQ(bool b )

Operational

See examples

Versions

  • See changelog.md
  • See DHTNEW or DHTStable library for latest stable version for all platforms.

Future

Must

  • improve documentation

Should

  • separate history versions CHANGELOG.md file ?

Could

  • improve unit tests
    • constants
  • move non public part of #defines to .cpp

Wont

  • updates only on request basis (bugs)

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,