Package com.ctre.phoenix.led
Class TwinkleOffAnimation
java.lang.Object
com.ctre.phoenix.led.Animation
com.ctre.phoenix.led.TwinkleOffAnimation
public class TwinkleOffAnimation extends Animation
Animation that randomly turns on LEDs, until it reaches the maximum count and turns them all off
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TwinkleOffAnimation.TwinkleOffPercent
The maximum percentage of LEDs that are allowed to turn on -
Constructor Summary
Constructors Constructor Description TwinkleOffAnimation(int r, int g, int b)
Constructor for a TwinklOffeAnimationTwinkleOffAnimation(int r, int g, int b, int w, double speed, int numLed, TwinkleOffAnimation.TwinkleOffPercent divider)
Constructor for a TwinkleAnimationTwinkleOffAnimation(int r, int g, int b, int w, double speed, int numLed, TwinkleOffAnimation.TwinkleOffPercent divider, int ledOffset)
Constructor for a TwinkleAnimation -
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
setDivider(TwinkleOffAnimation.TwinkleOffPercent divider)
Sets the percentage of LEDs that are allowed onvoid
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
-
TwinkleOffAnimation
public TwinkleOffAnimation(int r, int g, int b, int w, double speed, int numLed, TwinkleOffAnimation.TwinkleOffPercent divider, int ledOffset)Constructor for a TwinkleAnimation- 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 the CANdle controlsdivider
- What percentage of LEDs can be on at any pointledOffset
- Where to start the animation
-
TwinkleOffAnimation
public TwinkleOffAnimation(int r, int g, int b, int w, double speed, int numLed, TwinkleOffAnimation.TwinkleOffPercent divider)Constructor for a TwinkleAnimation- 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 the CANdle controlsdivider
- What percentage of LEDs can be on at any point
-
TwinkleOffAnimation
Constructor for a TwinklOffeAnimation- 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
-
setDivider
Sets the percentage of LEDs that are allowed on- Parameters:
divider
- The percentage of LEDs that are allowed on at any point
-
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()
-