View Source BH1750.Sensor (bh1750 v0.2.0)

The BH1750 sensor.

Link to this section Summary

Types

t()

The BH1750 sensor

Functions

Measures the ambient light.

Instantiates a BH1750 sensor.

Powers down the BH1750 sensor.

Link to this section Types

Specs

option() ::
  {:bus_name, binary()}
  | {:address, 35 | 92}
  | {:mode, BH1750.Config.mode()}
  | {:resolution, BH1750.Config.resolution()}

Specs

t() :: %BH1750.Sensor{
  config: BH1750.Config.t(),
  transport: BH1750.Transport.t()
}

The BH1750 sensor

Link to this section Functions

Specs

measure(t()) :: {:ok, 65535} | {:error, any()}

Measures the ambient light.

Specs

new([option()]) :: t()

Instantiates a BH1750 sensor.

Specs

power_down(t()) :: :ok | {:error, any()}

Powers down the BH1750 sensor.