pyupm_bh1750 module

class pyupm_bh1750.BH1750(bus=0, addr=35, mode=4)[source]

Bases: object

UPM C API for the DFRobot I2C BH1750 Light Sensor.

ID: bh1750

Name: Digital Light Sensor

Category: light

Manufacturer: 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.

C++ includes: bh1750.hpp

getLux()[source]

float getLux()

Get the measured light intensity in Lux.

The measured light intensity in Lux.

powerDown()[source]

void powerDown()

Power down the device.

powerUp()[source]

void powerUp()

Power up the device.

reset()[source]

void 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.

setOpmode(mode)[source]

void setOpmode(BH1750_OPMODES_T mode)

Setup the device to match the selected operating mode.

mode: operating mode, one of the BH1750_OPMODES_T values