View Source APDS9960.ALS (apds9960 v0.4.0)

The ambient light and RGB color sensing.

Link to this section Summary

Link to this section Functions

Specs

clear_interrupt(APDS9960.Sensor.t()) :: :ok
Link to this function

enable(sensor, value \\ 1)

View Source

Specs

enable(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_interrupt(sensor, value \\ 1)

View Source

Specs

enable_interrupt(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_saturation_interrupt(sensor, value \\ 1)

View Source

Specs

enable_saturation_interrupt(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_wait(sensor, value \\ 1)

View Source

Specs

enable_wait(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_wait_long(sensor, value \\ 1)

View Source

Specs

enable_wait_long(APDS9960.Sensor.t(), 0 | 1) :: :ok

Specs

enabled?(APDS9960.Sensor.t()) :: boolean()
Link to this function

get_adc_integration_time(sensor)

View Source

Specs

get_adc_integration_time(APDS9960.Sensor.t()) :: byte()

Specs

get_gain(APDS9960.Sensor.t()) :: 0..3
Link to this function

get_interrupt_persistence(sensor)

View Source

Specs

get_interrupt_persistence(APDS9960.Sensor.t()) :: 0..15

Specs

get_threshold(APDS9960.Sensor.t()) :: %{high: 0..65535, low: 0..65535}

Specs

get_wait_time(APDS9960.Sensor.t()) :: byte()
Link to this function

interrupt_enabled?(sensor)

View Source

Specs

interrupt_enabled?(APDS9960.Sensor.t()) :: boolean()
Link to this function

read_color(sensor, opts \\ [])

View Source

Specs

read_color(APDS9960.Sensor.t(), Enum.t()) :: %{
  red: 0..65535,
  green: 0..65535,
  blue: 0..65535,
  clear: 0..65535
}
Link to this function

saturation_interrupt_enabled?(sensor)

View Source

Specs

saturation_interrupt_enabled?(APDS9960.Sensor.t()) :: boolean()
Link to this function

set_adc_integration_time(sensor, byte)

View Source

Specs

set_adc_integration_time(APDS9960.Sensor.t(), byte()) :: :ok

Specs

set_gain(APDS9960.Sensor.t(), 0..3) :: :ok
Link to this function

set_interrupt_persistence(sensor, byte)

View Source

Specs

set_interrupt_persistence(APDS9960.Sensor.t(), 0..15) :: :ok
Link to this function

set_threshold(sensor, arg)

View Source

Specs

set_threshold(
  APDS9960.Sensor.t(),
  {low :: 0..65535, high :: 0..65535}
) :: :ok
Link to this function

set_wait_time(sensor, byte)

View Source

Specs

set_wait_time(APDS9960.Sensor.t(), byte()) :: :ok

Specs

settings(APDS9960.Sensor.t()) :: %{
  adc_integration_time: byte(),
  enabled: boolean(),
  gain: 0..3,
  interrupt_enabled: boolean(),
  interrupt_persistence: byte(),
  saturation_interrupt: boolean(),
  threshold: %{high: 65535, low: 65535},
  wait_long_enabled: boolean(),
  wait_time: byte()
}

Returns all the current Color / ALS settings.

Specs

status(APDS9960.Sensor.t()) :: %{
  clear_photo_diode_saturation: boolean(),
  interrupt: boolean(),
  valid: boolean()
}

Specs

wait_enabled?(APDS9960.Sensor.t()) :: boolean()
Link to this function

wait_long_enabled?(sensor)

View Source

Specs

wait_long_enabled?(APDS9960.Sensor.t()) :: boolean()