mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
33 lines
951 B
ReStructuredText
33 lines
951 B
ReStructuredText
HDC1080 Temperature/Humidity Sensor
|
|
===================================
|
|
|
|
The HDC1080 component allows you get accurate temperature and humidity readings from your HDC1080
|
|
(`datasheet <http://www.ti.com/lit/ds/symlink/hdc1080.pdf>`_,
|
|
`adafruit <https://www.adafruit.com/product/2635>`_) sensors with esphomelib. To use these
|
|
i2c-based devices, first initialize the i2c bus using the pins you have for SDA and SCL and
|
|
then create the sensors themselves as in below example.
|
|
|
|
Example Usage
|
|
-------------
|
|
|
|
.. code-block:: cpp
|
|
|
|
// inside setup()
|
|
App.init_i2c(SDA_PIN, SCL_PIN); // change these values for your pins.
|
|
// create sensors
|
|
App.make_hdc1080_sensor("Outside Temperature", "Outside Humidity");
|
|
|
|
.. cpp:namespace:: nullptr
|
|
|
|
See :cpp:func:`Application::make_hdc1080_sensor`.
|
|
|
|
API Reference
|
|
-------------
|
|
|
|
.. cpp:namespace:: nullptr
|
|
|
|
.. doxygenclass:: sensor::HDC1080Component
|
|
:members:
|
|
:protected-members:
|
|
:undoc-members:
|