CTRE Phoenix C++ 5.36.0-beta-1
Loading...
Searching...
No Matches
ColorFlowAnimation.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 gradually lights the entire LED strip one LED at a time.
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 * What direction does the color go
27 */
28 enum Direction {
29 /**
30 * Color goes forward, away from CANdle
31 */
32 Forward = 0,
33 /**
34 * Color goes backward, toward CANdle
35 */
36 Backward = 1,
37 };
38
39 /**
40 * Constructor for a ColorFlowAnimation
41 * @param r How much red should the color have [0, 255]
42 * @param g How much green should the color have [0, 255]
43 * @param b How much blue should the color have [0, 255]
44 * @param w How much white should the color have [0, 255]
45 * @param speed How fast should the color travel the strip [0, 1]
46 * @param numLed How many LEDs is the CANdle controlling
47 * @param direction What direction should the color move in
48 * @param ledOffset Where to start the animation
49 */
50 ColorFlowAnimation(int r, int g, int b, int w, double speed = 1, int numLed = -1, Direction direction = Direction::Forward, int ledOffset = 0);
51
52 /**
53 * Sets the direction the color flow moves in
54 * @param direction What direction should the color move in
55 */
56 void SetDirection(Direction direction);
57};
58
59} // namespace led
60} // namespace phoenix
61} // namespace ctre
The base class for one generic type of animation.
Definition BaseTwoSizeAnimation.h:24
Animation that gradually lights the entire LED strip one LED at a time.
Definition ColorFlowAnimation.h:23
void SetDirection(Direction direction)
Sets the direction the color flow moves in.
ColorFlowAnimation(int r, int g, int b, int w, double speed=1, int numLed=-1, Direction direction=Direction::Forward, int ledOffset=0)
Constructor for a ColorFlowAnimation.
Direction
What direction does the color go.
Definition ColorFlowAnimation.h:28
WPI Compliant Pigeon class.
Definition PigeonIMU_StickyFaults.h:6