CTRE Phoenix C++ 5.33.1
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 */
12public:
13 /**
14 * What direction does the color go
15 */
16 enum Direction {
17 /**
18 * Color goes forward, away from CANdle
19 */
21 /**
22 * Color goes backward, toward CANdle
23 */
25 };
26
27 /**
28 * Constructor for a ColorFlowAnimation
29 * @param r How much red should the color have [0, 255]
30 * @param g How much green should the color have [0, 255]
31 * @param b How much blue should the color have [0, 255]
32 * @param w How much white should the color have [0, 255]
33 * @param speed How fast should the color travel the strip [0, 1]
34 * @param numLed How many LEDs is the CANdle controlling
35 * @param direction What direction should the color move in
36 * @param ledOffset Where to start the animation
37 */
38 ColorFlowAnimation(int r, int g, int b, int w, double speed = 1, int numLed = -1, Direction direction = Direction::Forward, int ledOffset = 0);
39
40 /**
41 * Sets the direction the color flow moves in
42 * @param direction What direction should the color move in
43 */
44 void SetDirection(Direction direction);
45};
46
47} // namespace led
48} // namespace phoenix
49} // namespace ctre
The base class for one generic type of animation.
Definition: BaseTwoSizeAnimation.h:12
Animation that gradually lights the entire LED strip one LED at a time.
Definition: ColorFlowAnimation.h:11
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:16
@ Forward
Color goes forward, away from CANdle.
Definition: ColorFlowAnimation.h:20
@ Backward
Color goes backward, toward CANdle.
Definition: ColorFlowAnimation.h:24
namespace ctre
Definition: paramEnum.h:5