This commit is contained in:
samuel desharnais
2026-03-31 20:29:45 -04:00
parent 7b535a845f
commit 3b06cbd447
2 changed files with 39 additions and 5 deletions

View File

@@ -0,0 +1,39 @@
/* Generated by Phoenix Tuner X */
package frc.robot.subsystems;
import static edu.wpi.first.units.Units.*;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix6.CANBus;
import com.ctre.phoenix6.controls.SolidColor;
import com.ctre.phoenix6.hardware.CANdle;
import com.ctre.phoenix6.signals.RGBWColor;
/**
* Subsystem that controls an addressable LED strip using a CANdle.
*/
public class LEDSubsystem extends SubsystemBase {
private final CANBus kCANBus = new CANBus("rio");
private final CANdle m_candle = new CANdle(17, kCANBus);
public void Bleu(){
m_candle.setControl(new SolidColor(0, 80).withColor(new RGBWColor(255, 0, 0, 0)));
}
public void Rouge(){
new SolidColor(0, 80).withColor(new RGBWColor(0, 0, 255, 0));
}
public LEDSubsystem() {
setDefaultCommand(updateLEDs());
}
/**
* Updates the animations and LEDs of the CANdle.
*
* @return Command to run
*/
public Command updateLEDs() {
return run(() -> {});
}
}