GY-63_MS5611/libraries/DHTlib/readme.md

130 lines
3.5 KiB
Markdown
Raw Normal View History

2021-01-29 06:31:58 -05:00
[![Arduino CI](https://github.com/RobTillaart/DHTlib/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
2021-11-13 13:57:17 -05:00
[![Arduino-lint](https://github.com/RobTillaart/DHTlib/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/DHTlib/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/DHTlib/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/DHTlib/actions/workflows/jsoncheck.yml)
2023-10-25 11:25:03 -04:00
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/DHTlib.svg)](https://github.com/RobTillaart/DHTlib/issues)
2021-01-29 06:31:58 -05:00
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/DHTlib/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/DHTlib.svg?maxAge=3600)](https://github.com/RobTillaart/DHTlib/releases)
2023-10-25 11:25:03 -04:00
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/DHTlib.svg)](https://registry.platformio.org/libraries/robtillaart/DHTlib)
2021-01-29 06:31:58 -05:00
2021-11-13 13:57:17 -05:00
2020-11-27 05:10:47 -05:00
# DHTlib
Arduino library for DHT temperature and humidity sensor. AVR optimized
2017-07-27 09:43:45 -04:00
2021-11-13 13:57:17 -05:00
2017-07-27 09:43:45 -04:00
## Description
The DHT11, 21, 22, 33 and 44 are relative inexpensive sensors for measuring temperature and humidity.
2014-02-10 12:56:10 -05:00
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)
2014-02-10 12:56:10 -05:00
The hardware pins of the sensors and handshake are identical so ideal to combine in one lib.
2014-11-16 08:25:44 -05:00
The library (0.1.13 version) is confirmed to work on:
2014-02-10 12:56:10 -05:00
2021-01-29 06:31:58 -05:00
- UNO (tested myself)
- 2009 (tested myself)
- MEGA2560
- DUE
- attiny85 @8MHz
- Digistump Digix @ 84 MHz
2017-07-27 09:43:45 -04:00
2020-11-27 05:10:47 -05:00
Later 0.1.xx versions are optimized for AVR only.
2014-02-10 12:56:10 -05:00
2020-04-05 13:52:38 -04:00
More information - http://playground.arduino.cc/Main/DHTLib -
2020-11-27 05:10:47 -05:00
For latest version for the DHT, check https://github.com/RobTillaart/DHTNEW
2021-11-13 13:57:17 -05:00
2020-11-27 05:10:47 -05:00
## DHT PIN layout from left to right
2021-11-13 13:57:17 -05:00
| Front | | Description |
|:------|:----:|:--------------|
| pin 1 | | VCC |
| pin 2 | | DATA |
| pin 3 | | Not Connected |
| pin 4 | | GND |
2023-10-25 11:25:03 -04:00
## Interface
```cpp
#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 )**
2020-11-27 05:10:47 -05:00
2017-07-27 09:43:45 -04:00
## Operational
2020-11-27 05:10:47 -05:00
See examples
2017-07-27 09:43:45 -04:00
2023-10-25 11:25:03 -04:00
## Versions
- See changelog.md
- See DHTNEW or DHTStable library for latest stable version for all platforms.
2021-12-16 10:44:08 -05:00
## Future
2023-10-25 11:25:03 -04:00
#### Must
2021-12-16 10:44:08 -05:00
- improve documentation
2023-10-25 11:25:03 -04:00
#### Should
- separate history versions CHANGELOG.md file ?
#### Could
2021-12-16 10:44:08 -05:00
- improve unit tests
- constants
- move non public part of #defines to .cpp
2023-10-25 11:25:03 -04:00
#### 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,
2020-11-27 05:10:47 -05:00