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
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
get_state()
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.
increment_color(color)
Increment the current color with each component value and update the light.
increment_intensity_set_color(color, intensity)
set_color(color)
Set the current color and update the light.
Components that are set to nil will not be changed.
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})
set_state(state)
Sets the current state of the WarningLight.