esphome-docs/api/sensor/tsl2561.rst

38 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
TSL2561 Ambient Light Sensor
============================
The TSL2561 sensor allows you to use your TSL2561 i2c-enabled ambient light sensor with
esphomelib (`datasheet <https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf>`__,
`Adafruit <https://www.adafruit.com/product/439>`__). It requires i2c to be setup to work.
Example Usage
-------------
.. code-block:: cpp
// Basic
auto tsl2561 = App.make_tsl2561_sensor("TSL2561 Illuminance Sensor");
// Advanced settings
// set the time the sensor will take for value accumulation, default: 402 ms
tsl2561.tsl2561->set_integration_time(sensor::TSL2561_INTEGRATION_14MS);
// set a higher gain for low light conditions, default: 1x
tsl2561.tsl2561->set_gain(sensor::TSL2561_GAIN_16X);
2018-05-14 21:15:49 +02:00
.. cpp:namespace:: nullptr
2018-05-13 11:37:02 +02:00
See :cpp:func:`Application::make_tsl2561_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::TSL2561Sensor
:members:
:protected-members:
:undoc-members:
.. doxygenenum:: sensor::TSL2561IntegrationTime
.. doxygenenum:: sensor::TSL2561Gain