phoenix6.controls.color_flow_animation

Module Contents

class phoenix6.controls.color_flow_animation.ColorFlowAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), direction: AnimationDirectionValue = AnimationDirectionValue.FORWARD, frame_rate: phoenix6.units.hertz = 25)

Animation that gradually lights the entire LED strip one LED at a time.

Parameters:
  • led_start_index (int) –

    The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

    If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • led_end_index (int) –

    The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

    If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • direction (AnimationDirectionValue) – The direction of the animation.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, turning one on or off.

property name: str

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = 20

The period at which this control will update at. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms).

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

led_end_index

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

slot

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color

The color to use in the animation.

direction

The direction of the animation.

frame_rate

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

with_led_start_index(new_led_start_index: int) ColorFlowAnimation

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_led_end_index(new_led_end_index: int) ColorFlowAnimation

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_slot(new_slot: int) ColorFlowAnimation

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_color(new_color: RGBWColor) ColorFlowAnimation

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_direction(new_direction: AnimationDirectionValue) ColorFlowAnimation

Modifies this Control Request’s direction parameter and returns itself for method-chaining and easier to use request API.

The direction of the animation.

Parameters:

new_direction (AnimationDirectionValue) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) ColorFlowAnimation

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) ColorFlowAnimation

Sets the period at which this control will update at. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms).

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation