adafruit_bh1750
CircuitPython library for use with the Adafruit BH1750 breakout
Author(s): Bryan Siepert
Implementation Notes
Hardware:
Adafruit BH1750 Light Sensor (Product ID: 4681)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_bh1750.BH1750(i2c: I2C, address: int = 35)
Library for the BH1750 Sensor
- Parameters:
Quickstart: Importing and using the BH1750
Here is an example of using the
BH1750
class. First you will need to import the libraries to use the sensorimport board import adafruit_bh1750
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA sensor = adafruit_bh1750.BH1750(i2c)
Now you have access to the
lux
value in luxlux = sensor.lux
- resolution
The resolution of the sensor. See
Resolution
for valid values.
- class adafruit_bh1750.Resolution
Options for
resolution
Valid values areLOW
,MID
, andHIGH