# HDC1080 Managed Sensor Service Example Demonstrates the simplest possible usage of the HDC1080 managed sensor service. The driver handles all I2C setup and periodic polling automatically — you just read values when you need them. ## What This Example Shows - Initializing the sensor service (one function call). - Reading temperature, humidity, and derived values (dew point, SVP, VPD). - Checking the sensor status byte for errors. - Using `hdc1080_clear_error()` to acknowledge errors and resume polling. - Clean shutdown with `hdc1080_deinit()`. ## Configuration All settings are in menuconfig under **Component config → HDC1080 Driver Configuration**: - I2C pins (SCL, SDA), port, and frequency. - Sensor poll rate (how often the driver reads the sensor). - Conversion wait time. Run `idf.py menuconfig` to adjust these before building. ## Wiring (Default Menuconfig Values) | ESP32 Pin | HDC1080 Pin | |-----------|-------------| | GPIO 22 | SCL | | GPIO 21 | SDA | | 3.3V | VCC | | GND | GND | ## Build and Flash ```bash idf.py set-target esp32 idf.py build idf.py -p PORT flash monitor ``` ## Expected Output ``` I (xxx) hdc1080_example: HDC1080 SENSOR SERVICE STARTED I (xxx) hdc1080_example: POLLING AUTOMATICALLY - JUST READ VALUES WHEN YOU NEED THEM I (xxx) hdc1080_example: --- READING #1 --- I (xxx) hdc1080_example: TEMPERATURE: 24.16 °C I (xxx) hdc1080_example: HUMIDITY: 37.12 % I (xxx) hdc1080_example: DEW POINT: 8.52 °C I (xxx) hdc1080_example: SVP: 3.01 kPa I (xxx) hdc1080_example: VPD: 1.89 kPa ... I (xxx) hdc1080_example: SENSOR SERVICE STOPPED - EXAMPLE COMPLETE ``` ## Requirements - ESP-IDF v5.2 or later - Any ESP32 target with I2C support - HDC1080 sensor module
To create a project from this example, run:
idf.py create-project-from-example "grstat/hdc1080=1.0.2:hdc1080_example_main"