CTRE_Phoenix 5.20.2
ctre::phoenix::led::TwinkleOffAnimation Class Reference

#include <TwinkleOffAnimation.h>

Inherits ctre::phoenix::led::BaseTwoSizeAnimation.

Public Types

enum  TwinkleOffPercent {
  Percent100 = 0 , Percent88 = 1 , Percent76 = 2 , Percent64 = 3 ,
  Percent42 = 4 , Percent30 = 5 , Percent18 = 6 , Percent6 = 7
}
 

Public Member Functions

 TwinkleOffAnimation (int r, int g, int b, int w=0, double speed=1, int numLed=-1, TwinkleOffPercent divider=TwinkleOffPercent::Percent100)
 
void SetDivider (TwinkleOffPercent divider)
 
- 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)
 
BaseStandardAnimationGetBaseStandardAnimation ()
 
BaseTwoSizeAnimationGetBaseTwoSizeAnimation ()
 
void SetR (int r)
 
void SetG (int g)
 
void SetB (int b)
 
void SetW (int w)
 
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)
 
void SetSpeed (double speed)
 
void SetNumLed (int numLed)
 
virtual BaseStandardAnimationGetBaseStandardAnimation ()=0
 
virtual BaseTwoSizeAnimationGetBaseTwoSizeAnimation ()=0
 
int GetAnimationIdx ()
 
double GetSpeed ()
 
int GetNumLed ()
 

Detailed Description

Animation that randomly turns on LEDs, until it reaches the maximum count and turns them all off

Member Enumeration Documentation

◆ TwinkleOffPercent

The maximum percentage of LEDs that are allowed to turn on

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

◆ TwinkleOffAnimation()

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

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

Member Function Documentation

◆ SetDivider()

void ctre::phoenix::led::TwinkleOffAnimation::SetDivider ( TwinkleOffPercent  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: