CTRE Phoenix C++ 5.33.1
TwinkleOffAnimation.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 on LEDs, until it reaches the maximum count and turns them all off
10 */
12public:
13 /**
14 * The maximum percentage of LEDs that are allowed to turn on
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 TwinkleOffAnimation(int r, int g, int b, int w = 0, double speed = 1, int numLed = -1, TwinkleOffPercent divider = TwinkleOffPercent::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 on LEDs, until it reaches the maximum count and turns them all off.
Definition: TwinkleOffAnimation.h:11
TwinkleOffAnimation(int r, int g, int b, int w=0, double speed=1, int numLed=-1, TwinkleOffPercent divider=TwinkleOffPercent::Percent100, int ledOffset=0)
Constructor for a TwinkleAnimation.
TwinkleOffPercent
The maximum percentage of LEDs that are allowed to turn on.
Definition: TwinkleOffAnimation.h:16
@ Percent100
All the LEDs are allowed to turn on.
Definition: TwinkleOffAnimation.h:20
@ Percent42
42% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:36
@ Percent64
64% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:32
@ Percent76
76% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:28
@ Percent6
6% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:48
@ Percent30
30% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:40
@ Percent18
18% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:44
@ Percent88
88% of LEDs are allowed to turn on
Definition: TwinkleOffAnimation.h:24
void SetDivider(TwinkleOffPercent divider)
Sets the percentage of LEDs that are allowed on.
namespace ctre
Definition: paramEnum.h:5