CTRE Phoenix C++ 5.36.0-beta-1
Loading...
Searching...
No Matches
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 *
11 * @deprecated This device's Phoenix 5 API is deprecated for removal in the
12 * 2027 season. Users should update to Phoenix 6 firmware and migrate to the
13 * Phoenix 6 API. A migration guide is available at
14 * https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.
15 *
16 * If the Phoenix 5 API must be used for this device, the device must have 22.X
17 * firmware. This firmware is available in Tuner X after selecting Phoenix 5 in
18 * the firmware year dropdown.
19 */
20class [[deprecated("This device's Phoenix 5 API is deprecated for removal in the 2027 season."
21 "Users should update to Phoenix 6 firmware and migrate to the Phoenix 6 API."
22 "A migration guide is available at https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html")]]
24public:
25 /**
26 * The percentage of LEDs that are allowed to be on at any one point
27 */
29 /**
30 * All the LEDs are allowed to turn on
31 */
32 Percent100 = 0,
33 /**
34 * 88% of LEDs are allowed to turn on
35 */
36 Percent88 = 1,
37 /**
38 * 76% of LEDs are allowed to turn on
39 */
40 Percent76 = 2,
41 /**
42 * 64% of LEDs are allowed to turn on
43 */
44 Percent64 = 3,
45 /**
46 * 42% of LEDs are allowed to turn on
47 */
48 Percent42 = 4,
49 /**
50 * 30% of LEDs are allowed to turn on
51 */
52 Percent30 = 5,
53 /**
54 * 18% of LEDs are allowed to turn on
55 */
56 Percent18 = 6,
57 /**
58 * 6% of LEDs are allowed to turn on
59 */
60 Percent6 = 7,
61 };
62
63 /**
64 * Constructor for a TwinkleAnimation
65 * @param r How much red should the color have [0, 255]
66 * @param g How much green should the color have [0, 255]
67 * @param b How much blue should the color have [0, 255]
68 * @param w How much white should the color have [0, 255]
69 * @param speed How fast should the color travel the strip [0, 1]
70 * @param numLed How many LEDs the CANdle controls
71 * @param divider What percentage of LEDs can be on at any point
72 * @param ledOffset Where to start the animation
73 */
74 TwinkleAnimation(int r, int g, int b, int w = 0, double speed = 1, int numLed = -1, TwinklePercent divider = TwinklePercent::Percent100, int ledOffset = 0);
75 /**
76 * Sets the percentage of LEDs that are allowed on
77 * @param divider The percentage of LEDs that are allowed on at any point
78 */
80};
81
82} // namespace led
83} // namespace phoenix
84} // namespace ctre
The base class for one generic type of animation.
Definition BaseTwoSizeAnimation.h:24
Animation that randomly turns LEDs on and off to a certain color.
Definition TwinkleAnimation.h:23
TwinklePercent
The percentage of LEDs that are allowed to be on at any one point.
Definition TwinkleAnimation.h:28
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.
WPI Compliant Pigeon class.
Definition PigeonIMU_StickyFaults.h:6