CTRE Phoenix C++ 5.33.1
ctre::phoenix::led::TwinkleAnimation Class Reference

Animation that randomly turns LEDs on and off to a certain color. More...

#include <ctre/phoenix/led/TwinkleAnimation.h>

Inheritance diagram for ctre::phoenix::led::TwinkleAnimation:
ctre::phoenix::led::BaseTwoSizeAnimation ctre::phoenix::led::Animation

Public Types

enum  TwinklePercent {
  Percent100 = 0 , Percent88 = 1 , Percent76 = 2 , Percent64 = 3 ,
  Percent42 = 4 , Percent30 = 5 , Percent18 = 6 , Percent6 = 7
}
 The percentage of LEDs that are allowed to be on at any one point. More...
 

Public Member Functions

 TwinkleAnimation (int r, int g, int b, int w=0, double speed=1, int numLed=-1, TwinklePercent divider=TwinklePercent::Percent100, int ledOffset=0)
 Constructor for a TwinkleAnimation. More...
 
void SetDivider (TwinklePercent divider)
 Sets the percentage of LEDs that are allowed on. More...
 
- Public Member Functions inherited from ctre::phoenix::led::BaseTwoSizeAnimation
 BaseTwoSizeAnimation (int idx, int r, int g, int b, int w, double speed, int numLed, int direction, int size, int ledOffset)
 Constructor for the BaseStandardAnimation object. More...
 
 ~BaseTwoSizeAnimation ()
 
BaseStandardAnimationGetBaseStandardAnimation ()
 
BaseTwoSizeAnimationGetBaseTwoSizeAnimation ()
 
void SetR (int r)
 Sets the R value of the LEDs. More...
 
void SetG (int g)
 Sets the G value of the LEDs. More...
 
void SetB (int b)
 Sets the B value of the LEDs. More...
 
void SetW (int w)
 Sets the W value of the LEDs. More...
 
void SetDirection (int direction)
 
void SetSize (int size)
 
int GetR ()
 
int GetG ()
 
int GetB ()
 
int GetW ()
 
int GetDirection ()
 
int GetSize ()
 
- Public Member Functions inherited from ctre::phoenix::led::Animation
 Animation (int idx, double speed, int numLed, int ledOffset)
 Constructor for an Animation class. More...
 
virtual ~Animation ()
 
void SetSpeed (double speed)
 Sets the speed of the animation. More...
 
void SetNumLed (int numLed)
 Sets the number of LEDs the animation will run on. More...
 
void SetLedOffset (int ledOffset)
 Sets where the animation starts along the strip. More...
 
virtual BaseStandardAnimationGetBaseStandardAnimation ()=0
 
virtual BaseTwoSizeAnimationGetBaseTwoSizeAnimation ()=0
 
int GetAnimationIdx ()
 
double GetSpeed ()
 
int GetNumLed ()
 
int GetLedOffset ()
 

Detailed Description

Animation that randomly turns LEDs on and off to a certain color.

Member Enumeration Documentation

◆ TwinklePercent

The percentage of LEDs that are allowed to be on at any one point.

Enumerator
Percent100 

All the LEDs are allowed to turn on.

Percent88 

88% of LEDs are allowed to turn on

Percent76 

76% of LEDs are allowed to turn on

Percent64 

64% of LEDs are allowed to turn on

Percent42 

42% of LEDs are allowed to turn on

Percent30 

30% of LEDs are allowed to turn on

Percent18 

18% of LEDs are allowed to turn on

Percent6 

6% of LEDs are allowed to turn on

Constructor & Destructor Documentation

◆ TwinkleAnimation()

ctre::phoenix::led::TwinkleAnimation::TwinkleAnimation ( int  r,
int  g,
int  b,
int  w = 0,
double  speed = 1,
int  numLed = -1,
TwinklePercent  divider = TwinklePercent::Percent100,
int  ledOffset = 0 
)

Constructor for a TwinkleAnimation.

Parameters
rHow much red should the color have [0, 255]
gHow much green should the color have [0, 255]
bHow much blue should the color have [0, 255]
wHow much white should the color have [0, 255]
speedHow fast should the color travel the strip [0, 1]
numLedHow many LEDs the CANdle controls
dividerWhat percentage of LEDs can be on at any point
ledOffsetWhere to start the animation

Member Function Documentation

◆ SetDivider()

void ctre::phoenix::led::TwinkleAnimation::SetDivider ( TwinklePercent  divider)

Sets the percentage of LEDs that are allowed on.

Parameters
dividerThe percentage of LEDs that are allowed on at any point

The documentation for this class was generated from the following file: