CTRE Phoenix C++ 5.36.0-beta-1
Loading...
Searching...
No Matches
LarsonAnimation.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 sends a pocket of light across the LED strip.
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 * How the pocket of light behaves when it reaches the end of the strip
27 */
29 /**
30 * Bounce the pocket as soon as the first LED reaches the end of the strip
31 */
32 Front = 0,
33 /**
34 * Bounce the pocket once it is midway through the end of the strip
35 */
36 Center = 1,
37 /**
38 * Bounce the pocket once all the LEDs are off the strip
39 */
40 Back = 2,
41 };
42 /**
43 * Constructor for a LarsonAnimation
44 * @param r How much red should the color have [0, 255]
45 * @param g How much green should the color have [0, 255]
46 * @param b How much blue should the color have [0, 255]
47 * @param w How much white should the color have [0, 255]
48 * @param speed How fast should the color travel the strip [0, 1]
49 * @param numLed The number of LEDs the CANdle will control
50 * @param mode How the pocket of LEDs will behave once it reaches the end of the strip
51 * @param size How large the pocket of LEDs are [0, 7]
52 * @param ledOffset Where to start the animation
53 */
54 LarsonAnimation(int r, int g, int b, int w = 0, double speed = 1, int numLed = -1, BounceMode mode = BounceMode::Front, int size = 2, int ledOffset = 0);
55
56 /**
57 * Sets the bounce mode of the animation.
58 * @param mode How the pocket of LEDs will behave once it reaches the end of the strip
59 */
61
62 /**
63 * Sets the size of the pocket of LEDs
64 * @param size The size of the pocket [0, 7]
65 */
66 void SetSize(int size);
67};
68
69} // namespace led
70} // namespace phoenix
71} // namespace ctre
The base class for one generic type of animation.
Definition BaseTwoSizeAnimation.h:24
Animation that sends a pocket of light across the LED strip.
Definition LarsonAnimation.h:23
LarsonAnimation(int r, int g, int b, int w=0, double speed=1, int numLed=-1, BounceMode mode=BounceMode::Front, int size=2, int ledOffset=0)
Constructor for a LarsonAnimation.
void SetBounceMode(BounceMode mode)
Sets the bounce mode of the animation.
void SetSize(int size)
Sets the size of the pocket of LEDs.
BounceMode
How the pocket of light behaves when it reaches the end of the strip.
Definition LarsonAnimation.h:28
WPI Compliant Pigeon class.
Definition PigeonIMU_StickyFaults.h:6