This commit is contained in:
samuel desharnais 2024-02-20 18:52:44 -05:00
parent ef06de2957
commit c14b294395
2 changed files with 10 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.auto.NamedCommands;
import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
@ -56,9 +57,11 @@ public class RobotContainer {
Lanceur lanceur = new Lanceur();
Limelight limelight = new Limelight();
LED LED = new LED();
CommandJoystick joystick = new CommandJoystick(0);
CommandXboxController manette = new CommandXboxController(1);
CommandJoystick joystick = new CommandJoystick(0);
CommandXboxController manette = new CommandXboxController(1);
/*private final Relay blue = new Relay(0);
private final Relay rouge = new Relay(1);
private final Relay vert = new Relay(2);*/
//command
PistonFerme pistonFerme = new PistonFerme(grimpeur);
Balayer balayer = new Balayer(balayeuse, accumulateur);

View File

@ -6,13 +6,16 @@ package frc.robot.subsystem;
import edu.wpi.first.wpilibj.AddressableLED;
import edu.wpi.first.wpilibj.AddressableLEDBuffer;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class LED extends SubsystemBase {
/** Creates a new LED. */
public LED() {}
AddressableLED led = new AddressableLED(9);
AddressableLEDBuffer ledBuffer = new AddressableLEDBuffer(150);
public void led(){
led.setData(ledBuffer);
led.start();}
@ -21,10 +24,7 @@ public class LED extends SubsystemBase {
for (int i = 0; i < ledBuffer.getLength(); i++) {
// Sets the specified LED to the RGB values for red
ledBuffer.setRGB(i, 255, 0, 0);}
}
}
@Override
public void periodic() {
// This method will be called once per scheduler run