Skip to content

Esp-idf driver for DHT11 temperature and humidity sensor

License

Notifications You must be signed in to change notification settings

Anacron-sec/esp32-DHT11

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-DHT11

Esp-idf driver for DHT11 temperature and humidity sensor

Install

Use Platformio to install this link
or
Clone this repo inside [esp]/esp-idf/components folder

How to use

Import dht11.h inside your program, initialize the device with DHT11_init(gpio_num) and then call DHT11_read() whenever you need to read from the DHT11 sensor.
DHT11_read() returns a struct with temperature and humidity and a status code of the operation for error checking.

Check the examples folder for more information.

WARNING: DHT11_read() is a blocking function.