Package com.ctre.phoenix.led
Class LarsonAnimation
java.lang.Object
com.ctre.phoenix.led.Animation
com.ctre.phoenix.led.LarsonAnimation
public class LarsonAnimation extends Animation
Animation that sends a pocket of light across the LED strip.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LarsonAnimation.BounceMode
How the pocket of light behaves when it reaches the end of the strip -
Constructor Summary
Constructors Constructor Description LarsonAnimation(int r, int g, int b)
Constructor for a LarsonAnimationLarsonAnimation(int r, int g, int b, int w, double speed, int numLed, LarsonAnimation.BounceMode mode, int size)
Constructor for a LarsonAnimationLarsonAnimation(int r, int g, int b, int w, double speed, int numLed, LarsonAnimation.BounceMode mode, int size, int ledOffset)
Constructor for a LarsonAnimation -
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
setBounceMode(LarsonAnimation.BounceMode mode)
Sets the bounce mode of the animation.void
setG(int g)
Sets the G value of the LEDsvoid
setR(int r)
Sets the R value of the LEDsvoid
setSize(int size)
Sets the size of the pocket of LEDsvoid
setW(int w)
Sets the W value of the LEDs
-
Constructor Details
-
LarsonAnimation
public LarsonAnimation(int r, int g, int b, int w, double speed, int numLed, LarsonAnimation.BounceMode mode, int size, int ledOffset)Constructor for a LarsonAnimation- 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
- The number of LEDs the CANdle will controlmode
- How the pocket of LEDs will behave once it reaches the end of the stripsize
- How large the pocket of LEDs are [0, 7]ledOffset
- Where to start the animation
-
LarsonAnimation
public LarsonAnimation(int r, int g, int b, int w, double speed, int numLed, LarsonAnimation.BounceMode mode, int size)Constructor for a LarsonAnimation- 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
- The number of LEDs the CANdle will controlmode
- How the pocket of LEDs will behave once it reaches the end of the stripsize
- How large the pocket of LEDs are [0, 7]
-
LarsonAnimation
Constructor for a LarsonAnimation- 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
-
setBounceMode
Sets the bounce mode of the animation.- Parameters:
mode
- How the pocket of LEDs will behave once it reaches the end of the strip
-
setSize
Sets the size of the pocket of LEDs- Parameters:
size
- The size of the pocket [0, 7]
-
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()
-