blink_o_meter v1.0.0 BlinkOMeter.WarningLight

This module is responsible for controlling the warning light portion of BinkOMeter.

The direct API allows for changing the level through 3 functions.

  • set_color/1 - sets the level. Any value can be stored here, but values sent to the panel will be integers and be limited to the range of 0 to 255.
  • increment_color/1 - sets the level thourgh percentage. So acceptable values are in the 0 to 100 range.
  • set_intensity/1 - adds the sent value to the current value.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the current state of the WarningLight. The values are represented as follows

Increment the current color with each component value and update the light.

Set the current color and update the light.

Set just the intensity and update the light.

Sets the current state of the WarningLight.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Gets the current state of the WarningLight. The values are represented as follows:

  • color - the color last sent in by the client, component values can be a integers or floats and will be preserved.
  • former_color - the last color sent to the light. The compoonents of this will be integers between 0 and 255.
  • gpio_pin - the gpio pin on the RPI that the meter is connected to.
  • is_bound - whether or not this blinkometer instance connected to a remote instance at startup.
  • neopixel_channel - the neopixel channel the light has been initialized on.
Link to this function

increment_color(color)

Increment the current color with each component value and update the light.

Link to this function

increment_intensity_set_color(color, intensity)

Link to this function

set_color(color)

Set the current color and update the light.

Components that are set to nil will not be changed.

Link to this function

set_intensity(intensity)

Set just the intensity and update the light.

This is equivalent to set_color(%Color{red: nil, green: nil, blue: nil, intensity: intensity})

Link to this function

set_state(state)

Sets the current state of the WarningLight.