maximkulkin / esp-homekit-demo

Demo of Apple HomeKit accessory server library
MIT License
809 stars 233 forks source link

Need help with DHT sensor #253

Closed konifer44 closed 4 years ago

konifer44 commented 4 years ago

Hi guys, I know that dht.h comes with esp-open-rtos as an extra library, but Im new and I don't really know how to use external library, any step by step help here 😊?

maximkulkin commented 4 years ago

Here is an example of a thermostat that uses DHT sensor: https://github.com/maximkulkin/esp-homekit-demo/blob/master/examples/thermostat/thermostat.c#L177-L211.

Basically, what you need to do is:

  1. Include dht component in Makefile
  2. Include header file in source code
  3. Initialize pin your DHT sensor is connected to
  4. Periodically read data from sensor