#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "driver/gpio.h" #include "esp_rom_sys.h" #include "esp_log.h" #include "sdkconfig.h" static esp_err_t dht_attach_pin(); static esp_err_t get_change_time(uint8_t timeout_us, bool expected_level, uint32_t *time_us); static inline esp_err_t dht_communication(uint32_t *data); static inline int16_t data_to_int16(uint8_t MSB, uint8_t LSB); esp_err_t dht_read(float *temperature, float *humidity);