CTRE Phoenix C++ 5.33.1
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 */
12public:
13 /**
14 * How the pocket of light behaves when it reaches the end of the strip
15 */
17 /**
18 * Bounce the pocket as soon as the first LED reaches the end of the strip
19 */
20 Front = 0,
21 /**
22 * Bounce the pocket once it is midway through the end of the strip
23 */
24 Center = 1,
25 /**
26 * Bounce the pocket once all the LEDs are off the strip
27 */
28 Back = 2,
29 };
30 /**
31 * Constructor for a LarsonAnimation
32 * @param r How much red should the color have [0, 255]
33 * @param g How much green should the color have [0, 255]
34 * @param b How much blue should the color have [0, 255]
35 * @param w How much white should the color have [0, 255]
36 * @param speed How fast should the color travel the strip [0, 1]
37 * @param numLed The number of LEDs the CANdle will control
38 * @param mode How the pocket of LEDs will behave once it reaches the end of the strip
39 * @param size How large the pocket of LEDs are [0, 7]
40 * @param ledOffset Where to start the animation
41 */
42 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);
43
44 /**
45 * Sets the bounce mode of the animation.
46 * @param mode How the pocket of LEDs will behave once it reaches the end of the strip
47 */
49
50 /**
51 * Sets the size of the pocket of LEDs
52 * @param size The size of the pocket [0, 7]
53 */
54 void SetSize(int size);
55};
56
57} // namespace led
58} // namespace phoenix
59} // namespace ctre
The base class for one generic type of animation.
Definition: BaseTwoSizeAnimation.h:12
Animation that sends a pocket of light across the LED strip.
Definition: LarsonAnimation.h:11
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:16
@ Front
Bounce the pocket as soon as the first LED reaches the end of the strip.
Definition: LarsonAnimation.h:20
@ Center
Bounce the pocket once it is midway through the end of the strip.
Definition: LarsonAnimation.h:24
@ Back
Bounce the pocket once all the LEDs are off the strip.
Definition: LarsonAnimation.h:28
namespace ctre
Definition: paramEnum.h:5