esphome-docs/api/sensor/bh1750.rst

40 lines
947 B
ReStructuredText

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),
notify me on discord.
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);
.. cpp:namespace:: esphomelib
See :cpp:func:`Application::make_bh1750_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::BH1750Sensor
:members:
:protected-members:
:undoc-members:
.. doxygenenum:: sensor::BH1750Resolution