Class LarsonAnimation
- All Implemented Interfaces:
Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe behavior of the pocket of light when it reaches the end of the strip.The color to use in the animation.doubleThe frame rate of the animation, from [2, 1000] Hz.intThe index of the last LED this animation controls (inclusive).intThe index of the first LED this animation controls (inclusive).intThe number of LEDs in the pocket of light, up to 15.intThe slot of this animation, within [0, 7].doubleThe period at which this control will update at.Fields inherited from class com.ctre.phoenix6.controls.ControlRequest
name -
Constructor Summary
ConstructorsConstructorDescriptionLarsonAnimation(int LEDStartIndex, int LEDEndIndex) Animation that bounces a pocket of light across the LED strip. -
Method Summary
Modifier and TypeMethodDescriptionclone()Gets information about this control request.Helper method to get this Control Request's FrameRate parameter converted to a unit type.sendRequest(String network, int deviceHash) toString()withBounceMode(LarsonBounceValue newBounceMode) Modifies this Control Request's BounceMode parameter and returns itself for method-chaining and easier to use request API.Modifies this Control Request's Color parameter and returns itself for method-chaining and easier to use request API.withFrameRate(double newFrameRate) Modifies this Control Request's FrameRate parameter and returns itself for method-chaining and easier to use request API.withFrameRate(Frequency newFrameRate) Modifies this Control Request's FrameRate parameter and returns itself for method-chaining and easier to use request API.withLEDEndIndex(int newLEDEndIndex) Modifies this Control Request's LEDEndIndex parameter and returns itself for method-chaining and easier to use request API.withLEDStartIndex(int newLEDStartIndex) Modifies this Control Request's LEDStartIndex parameter and returns itself for method-chaining and easier to use request API.withSize(int newSize) Modifies this Control Request's Size parameter and returns itself for method-chaining and easier to use request API.withSlot(int newSlot) Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to use request API.withUpdateFreqHz(double newUpdateFreqHz) Sets the period at which this control will update at.withUpdateFreqHz(Frequency newUpdateFreqHz) Sets the period at which this control will update at.Methods inherited from class com.ctre.phoenix6.controls.ControlRequest
getName
-
Field Details
-
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. -
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. -
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. -
Size
The number of LEDs in the pocket of light, up to 15. -
BounceMode
The behavior of the pocket of light when it reaches the end of the strip. -
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, advancing the pocket of light by one LED.
- Units: Hz
-
UpdateFreqHz
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.
-
-
Constructor Details
-
LarsonAnimation
Animation that bounces a pocket of light across the LED strip.- Parameters:
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.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.
-
-
Method Details
-
toString
-
sendRequest
- Specified by:
sendRequestin classControlRequest
-
getControlInfo
Gets information about this control request.- Specified by:
getControlInfoin classControlRequest- Returns:
- Map of control parameter names and corresponding applied values
-
withLEDStartIndex
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.
- Parameters:
newLEDStartIndex- Parameter to modify- Returns:
- Itself
-
withLEDEndIndex
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.
- Parameters:
newLEDEndIndex- Parameter to modify- Returns:
- Itself
-
withSlot
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:
newSlot- Parameter to modify- Returns:
- Itself
-
withColor
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:
newColor- Parameter to modify- Returns:
- Itself
-
withSize
Modifies this Control Request's Size parameter and returns itself for method-chaining and easier to use request API.The number of LEDs in the pocket of light, up to 15.
- Parameters:
newSize- Parameter to modify- Returns:
- Itself
-
withBounceMode
Modifies this Control Request's BounceMode parameter and returns itself for method-chaining and easier to use request API.The behavior of the pocket of light when it reaches the end of the strip.
- Parameters:
newBounceMode- Parameter to modify- Returns:
- Itself
-
withFrameRate
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, advancing the pocket of light by one LED.
- Units: Hz
- Parameters:
newFrameRate- Parameter to modify- Returns:
- Itself
-
withFrameRate
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, advancing the pocket of light by one LED.
- Units: Hz
- Parameters:
newFrameRate- Parameter to modify- Returns:
- Itself
-
getFrameRateMeasure
Helper method to get this Control Request's FrameRate parameter converted to a unit type. If not using the Java units library,FrameRatecan be accessed directly instead.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, advancing the pocket of light by one LED.
- Units: Hz
- Returns:
- FrameRate
-
withUpdateFreqHz
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.
- Specified by:
withUpdateFreqHzin classControlRequest- Parameters:
newUpdateFreqHz- Parameter to modify- Returns:
- Itself
-
withUpdateFreqHz
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.
- Specified by:
withUpdateFreqHzin classControlRequest- Parameters:
newUpdateFreqHz- Parameter to modify- Returns:
- Itself
-
clone
-