esphome-docs/api/sensor/bh1750.rst

40 lines
977 B
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
BH1750 Ambient Light Sensor
===========================
.. warning::
This sensor is experimental has not been tested yet. If you can verify it works (or if it doesn't),
2018-05-16 20:02:48 +02:00
notify me on `discord <https://discord.gg/KhAMKrd>`__.
2018-05-13 11:37:02 +02:00
The BH1750 sensor allows you to use your BH1750 i2c-enabled ambient light sensor with
esphomelib (`datasheet <http://www.mouser.com/ds/2/348/bh1750fvi-e-186247.pdf>`__).
It requires i2c to be setup to work.
Example Usage
-------------
.. code-block:: cpp
// Basic
auto bh1750 = App.make_bh1750_sensor("BH1750 Illuminance");
// Advanced settings
// default resolution is 0.5 LX
bh1750.bh1750->set_resolution(sensor::BH1750_RESOLUTION_1P0_LX);
2018-05-14 21:15:49 +02:00
.. cpp:namespace:: nullptr
2018-05-13 11:37:02 +02:00
See :cpp:func:`Application::make_bh1750_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::BH1750Sensor
:members:
:protected-members:
:undoc-members:
.. doxygenenum:: sensor::BH1750Resolution