UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

BH1750 Class

Module: bh1750

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
)
Number

BH1750 object constructor (Analog mode)

Parameters:

  • bus Number

    The I2C bus to use

  • addr Number

    The I2C address of the device

  • mode BH1750_OPMODES_T

    The mode to start operation under. One of the BH1750_OPMODES_T values. The default is the highest precision, lowest power mode.

Returns:

Number:

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:

Number:

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_T

    operating mode, one of the BH1750_OPMODES_T values