CTRE Phoenix C++ 5.33.1
TwinkleAnimation.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
5
6namespace ctre {namespace phoenix {namespace led {
7
8/**
9 * Animation that randomly turns LEDs on and off to a certain color
10 */
12public:
13 /**
14 * The percentage of LEDs that are allowed to be on at any one point
15 */
17 /**
18 * All the LEDs are allowed to turn on
19 */
21 /**
22 * 88% of LEDs are allowed to turn on
23 */
25 /**
26 * 76% of LEDs are allowed to turn on
27 */
29 /**
30 * 64% of LEDs are allowed to turn on
31 */
33 /**
34 * 42% of LEDs are allowed to turn on
35 */
37 /**
38 * 30% of LEDs are allowed to turn on
39 */
41 /**
42 * 18% of LEDs are allowed to turn on
43 */
45 /**
46 * 6% of LEDs are allowed to turn on
47 */
49 };
50
51 /**
52 * Constructor for a TwinkleAnimation
53 * @param r How much red should the color have [0, 255]
54 * @param g How much green should the color have [0, 255]
55 * @param b How much blue should the color have [0, 255]
56 * @param w How much white should the color have [0, 255]
57 * @param speed How fast should the color travel the strip [0, 1]
58 * @param numLed How many LEDs the CANdle controls
59 * @param divider What percentage of LEDs can be on at any point
60 * @param ledOffset Where to start the animation
61 */
62 TwinkleAnimation(int r, int g, int b, int w = 0, double speed = 1, int numLed = -1, TwinklePercent divider = TwinklePercent::Percent100, int ledOffset = 0);
63 /**
64 * Sets the percentage of LEDs that are allowed on
65 * @param divider The percentage of LEDs that are allowed on at any point
66 */
68};
69
70} // namespace led
71} // namespace phoenix
72} // namespace ctre
The base class for one generic type of animation.
Definition: BaseTwoSizeAnimation.h:12
Animation that randomly turns LEDs on and off to a certain color.
Definition: TwinkleAnimation.h:11
TwinklePercent
The percentage of LEDs that are allowed to be on at any one point.
Definition: TwinkleAnimation.h:16
@ Percent18
18% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:44
@ Percent6
6% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:48
@ Percent100
All the LEDs are allowed to turn on.
Definition: TwinkleAnimation.h:20
@ Percent30
30% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:40
@ Percent76
76% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:28
@ Percent64
64% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:32
@ Percent42
42% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:36
@ Percent88
88% of LEDs are allowed to turn on
Definition: TwinkleAnimation.h:24
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.
void SetDivider(TwinklePercent divider)
Sets the percentage of LEDs that are allowed on.
namespace ctre
Definition: paramEnum.h:5