Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 929 Bytes

README.md

File metadata and controls

42 lines (28 loc) · 929 Bytes

BH1750

Hex version API docs CI

Use BH1750 16-bit ambient light sensor in Elixir.

Installation

Add bh1750 to your list of dependencies in mix.exs:

def deps do
  [
    {:bh1750, "~> 0.2"}
  ]
end

Usage

I2C address

I2C address can be either 0x23 (default) or 0x5C.

Start a sensor server

{:ok, sensor} = BH1750.start_link

Measure the ambient light

{:ok, lux} = BH1750.measure(sensor)

For more information, see API reference.