mnishiguchi / bh1750

Use BH1750 16-bit ambient light sensor in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Use BH1750 16-bit ambient light sensor in Elixir

License:MIT License


Languages

Language:Elixir 100.0%