BH1745Luminance (bh1745luminance v0.1.0)

Copy Markdown

Driver for the ROHM BH1745 RGB color/ambient light sensor (I2C address 0x39 by default).

Summary

Functions

Closes the I2C bus reference returned by open/2.

Opens the I2C bus and initializes the sensor: software reset, a 160ms measurement time, and starts continuous measurement at 1x gain.

Reads the current Red/Green/Blue/Clear (ambient light) values as a {r, g, b, clear} tuple of 16-bit integers. Waits 200ms for a measurement to complete before reading.

Functions

close(ref)

Closes the I2C bus reference returned by open/2.

open(bus_name \\ "i2c-2", i2c_address \\ 57)

Opens the I2C bus and initializes the sensor: software reset, a 160ms measurement time, and starts continuous measurement at 1x gain.

read_rgbw(ref, i2c_address \\ 57)

Reads the current Red/Green/Blue/Clear (ambient light) values as a {r, g, b, clear} tuple of 16-bit integers. Waits 200ms for a measurement to complete before reading.