BH1750 Class
- ID: bh1750
- Name: Digital Light Sensor
- Category: light
- Manufacturer: rohm dfrobot
- Connection: i2c
- Link: http://www.dfrobot.com/index.php?route=product/product&product_id=531
This driver was developed with the DFRobot Light Sensor based on the BH1750 . It has a sensitivity of .5 10 65535 Lux. It supports voltages from 3-5vdc and is connected via I2C.
Methods
BH1750
-
bus
-
addr
-
mode
BH1750 object constructor (Analog mode)
Parameters:
-
bus
NumberThe I2C bus to use
-
addr
NumberThe I2C address of the device
-
mode
BH1750_OPMODES_TThe mode to start operation under. One of the BH1750_OPMODES_T values. The default is the highest precision, lowest power mode.
Returns:
reset
()
Reset the device. This doesn't really have much purpose. The device must be powered up for this command to work. In addition, this command will simply clear the measurement register to 0.
getLux
()
Number
Get the measured light intensity in Lux.
Returns:
The measured light intensity in Lux.
powerUp
()
Power up the device.
powerDown
()
Power down the device.
setOpmode
-
mode
Setup the device to match the selected operating mode.
Parameters:
-
mode
BH1750_OPMODES_Toperating mode, one of the BH1750_OPMODES_T values