Package com.ctre.phoenix.led
Class ColorFlowAnimation
java.lang.Object
com.ctre.phoenix.led.Animation
com.ctre.phoenix.led.ColorFlowAnimation
public class ColorFlowAnimation extends Animation
Animation that gradually lights the entire LED strip one LED at a time.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ColorFlowAnimation.Direction
What direction does the color go -
Constructor Summary
Constructors Constructor Description ColorFlowAnimation(int r, int g, int b)
Constructor for a ColorFlowAnimationColorFlowAnimation(int r, int g, int b, int w, double speed, int numLed, ColorFlowAnimation.Direction direction)
Constructor for a ColorFlowAnimationColorFlowAnimation(int r, int g, int b, int w, double speed, int numLed, ColorFlowAnimation.Direction direction, int ledOffset)
Constructor for a ColorFlowAnimation -
Method Summary
Modifier and Type Method Description com.ctre.phoenix.led.BaseStandardAnimation
getBaseStandardAnimation()
com.ctre.phoenix.led.BaseTwoSizeAnimation
getBaseTwoSizeAnimation()
void
setB(int b)
Sets the B value of the LEDsvoid
setDirection(ColorFlowAnimation.Direction direction)
Sets the direction the color flow moves invoid
setG(int g)
Sets the G value of the LEDsvoid
setR(int r)
Sets the R value of the LEDsvoid
setW(int w)
Sets the W value of the LEDs
-
Constructor Details
-
ColorFlowAnimation
public ColorFlowAnimation(int r, int g, int b, int w, double speed, int numLed, ColorFlowAnimation.Direction direction, int ledOffset)Constructor for a ColorFlowAnimation- Parameters:
r
- How much red should the color have [0, 255]g
- How much green should the color have [0, 255]b
- How much blue should the color have [0, 255]w
- How much white should the color have [0, 255]speed
- How fast should the color travel the strip [0, 1]numLed
- How many LEDs is the CANdle controllingdirection
- What direction should the color move inledOffset
- Where to start the animation
-
ColorFlowAnimation
public ColorFlowAnimation(int r, int g, int b, int w, double speed, int numLed, ColorFlowAnimation.Direction direction)Constructor for a ColorFlowAnimation- Parameters:
r
- How much red should the color have [0, 255]g
- How much green should the color have [0, 255]b
- How much blue should the color have [0, 255]w
- How much white should the color have [0, 255]speed
- How fast should the color travel the strip [0, 1]numLed
- How many LEDs is the CANdle controllingdirection
- What direction should the color move in
-
ColorFlowAnimation
Constructor for a ColorFlowAnimation- Parameters:
r
- How much red should the color have [0, 255]g
- How much green should the color have [0, 255]b
- How much blue should the color have [0, 255]
-
-
Method Details
-
setDirection
Sets the direction the color flow moves in- Parameters:
direction
- What direction should the color move in
-
setR
public void setR(int r)Sets the R value of the LEDs- Parameters:
r
- The amount of red to set, a value between [0, 255]
-
setG
public void setG(int g)Sets the G value of the LEDs- Parameters:
g
- The amount of green to set, a value between [0, 255]
-
setB
public void setB(int b)Sets the B value of the LEDs- Parameters:
b
- The amount of blue to set, a value between [0, 255]
-
setW
public void setW(int w)Sets the W value of the LEDs- Parameters:
w
- The amount of white to set, a value between [0, 255]
-
getBaseStandardAnimation
public com.ctre.phoenix.led.BaseStandardAnimation getBaseStandardAnimation() -
getBaseTwoSizeAnimation
public com.ctre.phoenix.led.BaseTwoSizeAnimation getBaseTwoSizeAnimation()
-