From 1e962b904fc014a4cbf89d2d3c407edafad2d6bb Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Thu, 6 Feb 2025 17:36:44 -0500 Subject: [PATCH] led subsystem --- src/main/java/frc/robot/Bougie.java | 37 +++++++++++++++++++++ src/main/java/frc/robot/RobotContainer.java | 5 --- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 src/main/java/frc/robot/Bougie.java diff --git a/src/main/java/frc/robot/Bougie.java b/src/main/java/frc/robot/Bougie.java new file mode 100644 index 0000000..8a1ab28 --- /dev/null +++ b/src/main/java/frc/robot/Bougie.java @@ -0,0 +1,37 @@ +// 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; + +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); + } + public void Vert() { + candle.setLEDs(0, 255, 0); + } + public void Bleu() { + candle.setLEDs(0, 0, 255); + } + public void RainBow(){candle.animate(rainbowAnim);} + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} + diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 3c9c38c..513fc51 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -39,12 +39,7 @@ public class RobotContainer { } private void configureBindings() { - // Note that X is defined as forward according to WPILib convention, - // and Y is defined as to the left according to WPILib convention. - - // Run SysId routines when holding back/start and X/Y. - // Note that each routine should be run exactly once in a single log. }