Let's not use the argos_lib LED subsystem this time since it is not documented great and we probably just want to use standard animations for quick setup...
[x] Add constants to indicate address offsets for different strips
Example:
constexpr int startIndex_backLeft = 7; ///< Address of first LED in strip
constexpr int length_backLeft = 62; ///< Number of LEDs in strip
constexpr bool inverted_backLeft = false; ///< true indicates first index is at top of tower
constexpr int startIndex_backRight = 69;
constexpr int length_backRight = 62;
constexpr bool inverted_backRight = true;
constexpr int startIndex_sideBack = 131;
constexpr int length_sideBack = 62;
constexpr bool inverted_sideBack = false;
constexpr int startIndex_sideFront = 193;
constexpr int length_sideFront = 62;
constexpr bool inverted_sideFront = true;
constexpr int startIndex_frontLeft = 255;
constexpr int length_frontLeft = 31;
constexpr bool inverted_frontLeft = false;
constexpr int startIndex_frontRight = 286;
constexpr int length_frontRight = 31;
constexpr bool inverted_frontRight = true;
[x] Add functions to set solid color for each strip
// cpp
void LEDSubsystem::SetBackLeftSolidColor(frc::Color color) {
m_candle.ClearAnimation(0); // Stop any animations so we can do solid color
m_candle.SetLeds(color.red, color.green, color.blue, 0, startIndex_backLeft, length_backLeft);
}
Confirm we can set animations from CTRE library on spans of LEDs
Possible game plan:
drive
CAN bus to utilize CAN FD[x] Add functions to set solid color for each strip
// cpp void LEDSubsystem::SetBackLeftSolidColor(frc::Color color) { m_candle.ClearAnimation(0); // Stop any animations so we can do solid color m_candle.SetLeds(color.red, color.green, color.blue, 0, startIndex_backLeft, length_backLeft); }
[x] Add function to stock animate strips
// cpp void LEDSubsystem::FireEverywhere() { auto fireAnimationBL = ctre::phoenix::led::FireAnimation(1, 1, length_backLeft, 1, 1, inverted_backLeft, startIndex_backLeft); m_candle.Animate(fireAnimationBL, 0); auto fireAnimationBR = ctre::phoenix::led::FireAnimation(1, 1, length_backRight, 1, 1, inverted_backRight, startIndex_backRight); m_candle.Animate(fireAnimationBR, 1); auto fireAnimationSB = ctre::phoenix::led::FireAnimation(1, 1, length_sideBack, 1, 1, inverted_sideBack, startIndex_sideBack); m_candle.Animate(fireAnimationSB, 2); auto fireAnimationSF = ctre::phoenix::led::FireAnimation(1, 1, length_sideFront, 1, 1, inverted_sideFront, startIndex_sideFront); m_candle.Animate(fireAnimationSF, 3); auto fireAnimationFL = ctre::phoenix::led::FireAnimation(1, 1, length_frontLeft , 1, 1, inverted_frontLeft , startIndex_frontLeft ); m_candle.Animate(fireAnimationFL, 4); auto fireAnimationFR = ctre::phoenix::led::FireAnimation(1, 1, length_frontRight , 1, 1, inverted_frontRight , startIndex_frontRight ); m_candle.Animate(fireAnimationFR, 5); }