]> git.taranathan.com Git - FRC2026.git/commitdiff
more led patterns
authormaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Fri, 3 Apr 2026 20:36:08 +0000 (13:36 -0700)
committermaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Fri, 3 Apr 2026 20:36:08 +0000 (13:36 -0700)
src/main/java/frc/robot/subsystems/LED/LED2.java

index 2052e50cdf661fc5b8d850f6e7c2c22a009379f0..a0bfe8484eb8d318bc64fcb616c0a1d66d899082 100644 (file)
@@ -1,14 +1,18 @@
 package frc.robot.subsystems.LED;
 
 import java.util.Optional;
+import java.util.zip.GZIPInputStream;
 
 import com.ctre.phoenix6.configs.CANdleConfigurator;
 import com.ctre.phoenix6.configs.CANdleFeaturesConfigs;
 import com.ctre.phoenix6.configs.LEDConfigs;
 import com.ctre.phoenix6.controls.FireAnimation;
 import com.ctre.phoenix6.controls.LarsonAnimation;
+import com.ctre.phoenix6.controls.RainbowAnimation;
+import com.ctre.phoenix6.controls.RgbFadeAnimation;
 import com.ctre.phoenix6.controls.SolidColor;
 import com.ctre.phoenix6.controls.StrobeAnimation;
+import com.ctre.phoenix6.controls.TwinkleAnimation;
 import com.ctre.phoenix6.hardware.CANdle;
 import com.ctre.phoenix6.signals.Enable5VRailValue;
 import com.ctre.phoenix6.signals.LossOfSignalBehaviorValue;
@@ -66,6 +70,10 @@ public class LED2 extends SubsystemBase {
                SmartDashboard.putData("LED Strobe", new InstantCommand(() -> setStrobe()).ignoringDisable(true));
                SmartDashboard.putData("LED Static", new InstantCommand(() -> setStatic()).ignoringDisable(true));
                SmartDashboard.putData("LED Fire", new InstantCommand(() -> setFire()).ignoringDisable(true));
+               SmartDashboard.putData("LED Rainbow", new InstantCommand(() -> setRainbow()).ignoringDisable(true));
+               SmartDashboard.putData("LED Fade", new InstantCommand(() -> setRgbFadeAnimation()).ignoringDisable(true));
+               SmartDashboard.putData("LED Twinkle", new InstantCommand(() -> setTwinkle()).ignoringDisable(true));
+
                SmartDashboard.putData("LED Color Team Reset", new InstantCommand(() -> setColor()).ignoringDisable(true));
        }
 
@@ -102,7 +110,6 @@ public class LED2 extends SubsystemBase {
                if (underSecsToFlip(1.0) && fastFlippy) {
                        setFastStrobe();
                        fastFlippy = false;
-                       return;
                } else if (!underSecsToFlip(1.0) && !flippy) {
                        fastFlippy = true;
                }
@@ -122,6 +129,21 @@ public class LED2 extends SubsystemBase {
                candle.setControl(new FireAnimation(8, 8 + stripLength));
        }
 
+       public void setRainbow() {
+               candle.clearAllAnimations();
+               candle.setControl(new RainbowAnimation(8, 8 + stripLength));
+       }
+
+       public void setRgbFadeAnimation() {
+               candle.clearAllAnimations();
+               candle.setControl(new RgbFadeAnimation(8, 8 + stripLength));
+       }
+
+       public void setTwinkle() {
+               candle.clearAllAnimations();
+               candle.setControl(new TwinkleAnimation(8, 8 + stripLength));
+       }
+
        public void setStrobe() {
                candle.clearAllAnimations();
                candle.setControl(new StrobeAnimation(8, 8 + stripLength).withFrameRate(FLASH_RATE).withColor(new RGBWColor(color)));