Table of Contents

Class ColorFlowAnimation

Namespace
CTRE.Phoenix6.Controls
Assembly
Phoenix6.Hardware.dll

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

public sealed class ColorFlowAnimation : ControlRequest, ICloneable
Inheritance
ColorFlowAnimation
Implements
Inherited Members

Constructors

ColorFlowAnimation(int, int)

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

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. 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.
public ColorFlowAnimation(int LEDStartIndex, int LEDEndIndex)

Parameters

LEDStartIndex int
LEDEndIndex int

Fields

Color

The color to use in the animation.

public RGBWColor Color

Field Value

RGBWColor

Direction

The direction of the animation.

public AnimationDirectionValue Direction

Field Value

AnimationDirectionValue

FrameRate

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
public double FrameRate

Field Value

double

LEDEndIndex

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.
public int LEDEndIndex

Field Value

int

LEDStartIndex

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.
public int LEDStartIndex

Field Value

int

Slot

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

public int Slot

Field Value

int

UpdateFreqHz

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

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.
public double UpdateFreqHz

Field Value

double

Properties

Name

Name of this control request.

public string Name { get; }

Property Value

string

Methods

Clone()

Creates a copy of this control request.

public ColorFlowAnimation Clone()

Returns

ColorFlowAnimation

GetControlInfo()

Gets information about this control request.

public Dictionary<string, string> GetControlInfo()

Returns

Dictionary<string, string>

Dictionary of control parameter names and corresponding applied values

SendRequest(string, uint)

Sends this request out over CAN bus to the device for the device to apply.

public StatusCode SendRequest(string network, uint deviceHash)

Parameters

network string

Network to send request over

deviceHash uint

Device to send request to

Returns

StatusCode

Status of the send operation

ToString()

Provides the string representation of this object.

public override string ToString()

Returns

string

WithColor(RGBWColor)

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.
public ColorFlowAnimation WithColor(RGBWColor newColor)

Parameters

newColor RGBWColor

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithDirection(AnimationDirectionValue)

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

The direction of the animation.
public ColorFlowAnimation WithDirection(AnimationDirectionValue newDirection)

Parameters

newDirection AnimationDirectionValue

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithFrameRate(double)

Modifies this Control Request's FrameRate 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
public ColorFlowAnimation WithFrameRate(double newFrameRate)

Parameters

newFrameRate double

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithLEDEndIndex(int)

Modifies this Control Request's LEDEndIndex 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.
public ColorFlowAnimation WithLEDEndIndex(int newLEDEndIndex)

Parameters

newLEDEndIndex int

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithLEDStartIndex(int)

Modifies this Control Request's LEDStartIndex 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.
public ColorFlowAnimation WithLEDStartIndex(int newLEDStartIndex)

Parameters

newLEDStartIndex int

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithSlot(int)

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.
public ColorFlowAnimation WithSlot(int newSlot)

Parameters

newSlot int

Parameter to modify

Returns

ColorFlowAnimation

Itself

WithUpdateFreqHz(double)

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

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.
public ColorFlowAnimation WithUpdateFreqHz(double newUpdateFreqHz)

Parameters

newUpdateFreqHz double

Parameter to modify

Returns

ColorFlowAnimation

Itself