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

#include <LarsonAnimation.h>

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

Public Types

enum  BounceMode { Front = 0 , Center = 1 , Back = 2 }
 

Public Member Functions

 LarsonAnimation (int r, int g, int b, int w=0, double speed=1, int numLed=-1, BounceMode mode=BounceMode::Front, int size=2)
 
void SetBounceMode (BounceMode mode)
 
void SetSize (int size)
 
- 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 sends a pocket of light across the LED strip.

Member Enumeration Documentation

◆ BounceMode

How the pocket of light behaves when it reaches the end of the strip

Enumerator
Front 

Bounce the pocket as soon as the first LED reaches the end of the strip

Center 

Bounce the pocket once it is midway through the end of the strip

Back 

Bounce the pocket once all the LEDs are off the strip

Constructor & Destructor Documentation

◆ LarsonAnimation()

ctre::phoenix::led::LarsonAnimation::LarsonAnimation ( int  r,
int  g,
int  b,
int  w = 0,
double  speed = 1,
int  numLed = -1,
BounceMode  mode = BounceMode::Front,
int  size = 2 
)

Constructor for a LarsonAnimation

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]
numLedThe number of LEDs the CANdle will control
modeHow the pocket of LEDs will behave once it reaches the end of the strip
sizeHow large the pocket of LEDs are [0, 7]

Member Function Documentation

◆ SetBounceMode()

void ctre::phoenix::led::LarsonAnimation::SetBounceMode ( BounceMode  mode)

Sets the bounce mode of the animation.

Parameters
modeHow the pocket of LEDs will behave once it reaches the end of the strip

◆ SetSize()

void ctre::phoenix::led::LarsonAnimation::SetSize ( int  size)

Sets the size of the pocket of LEDs

Parameters
sizeThe size of the pocket [0, 7]

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