// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. package frc.robot.subsystems; import com.ctre.phoenix.led.CANdle; import com.ctre.phoenix.led.CANdleConfiguration; import com.ctre.phoenix.led.RainbowAnimation; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Bougie extends SubsystemBase { CANdle candle = new CANdle(5); CANdleConfiguration config = new CANdleConfiguration(); RainbowAnimation rainbowAnim = new RainbowAnimation(1, 0.5, 64); /** Creates a new Bougie. */ public Bougie() { config.brightnessScalar = 0.5; candle.configAllSettings(config); } public void Rouge() { candle.setLEDs(255, 0, 0,0,8,8); candle.setLEDs(255, 0, 0,0,24,8); candle.setLEDs(255, 0, 0,0,40,8); candle.setLEDs(255, 0, 0,0,56,8); } public void Vert() { candle.setLEDs(0, 255, 0,0,8,8); candle.setLEDs(0, 255, 0,0,24,8); candle.setLEDs(0, 255, 0,0,40,8); candle.setLEDs(0, 255, 0,0,56,8); } public void Bleu() { candle.setLEDs(0, 0, 255,0,16,8); candle.setLEDs(0, 0, 255,0,32,8); candle.setLEDs(0, 0, 255,0,48,8); candle.setLEDs(0, 0, 255,0,64,8); } public void Jaune() { candle.setLEDs(255, 215, 0,0,16,8); candle.setLEDs(255, 215, 0,0,32,8); candle.setLEDs(255, 215, 0,0,48,8); candle.setLEDs(255, 215, 0,0,64,8); } public void RainBow(){candle.animate(rainbowAnim);} public void RainBowStop(){candle.animate(null);} @Override public void periodic() { // This method will be called once per scheduler run } }