mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-11-18 11:15:36 +01:00
063b170d02
Still need to update some images
38 lines
1.1 KiB
ReStructuredText
38 lines
1.1 KiB
ReStructuredText
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);
|
|
|
|
.. cpp:namespace:: nullptr
|
|
|
|
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
|