text: #include <stdio.h>
  #include <freertos/FreeRTOS.h>
  #include <freertos/task.h>
  #include <dht.h>
  
  static const dht_sensor_type_t sensor_type = DHT_TYPE_AM2301;
  static const gpio_num_t dht_gpio = 17;
  
  
  void dht_test(void *pvParameters)
  {
      int16_t temperature = 0;
      int16_t humidity = 0;
  
      // DHT sensors that come mounted on a PCB generally have
      // pull-up resistors on the data pin.  It is recommended
      // to provide an external pull-up resistor otherwise...
  
      //gpio_set_pull_mode(dht_gpio, GPIO_PULLUP_ONLY);
  
      while (1)
      {
          if (dht_read_data(sensor_type, dht_gpio, &humidity, &temperature) == ESP_OK)
              printf("Humidity: %d%% Temp: %dC\n", humidity / 10, temperature / 10);
          else
              printf("Could not read data from sensor\n");
  
          // If you read the sensor data too often, it will heat up
          // http://www.kandrsmith.org/RJS/Misc/Hygrometers/dht_sht_how_fast.html
          vTaskDelay(2000 / portTICK_PERIOD_MS);
      }
  }
  
  void app_main()
  {
      xTaskCreate(dht_test, "dht_test", configMINIMAL_STACK_SIZE * 3, NULL, 5, NULL);
  }
  
  