diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index c040278..59272d9 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -107,7 +107,8 @@ public RobotContainer() { autoChooser.addOption("Rotate by 90", Autos.rotateTestAuto(drivetrain, 90, false)); autoChooser.addOption("Forward", Autos.driveAuto(drivetrain, +1)); autoChooser.addOption("Backward", Autos.driveAuto(drivetrain, -1)); - autoChooser.addOption("Make LEDs blue", new SetLightstripColor(lightStrip, 94)); + autoChooser.addOption("Make LEDs blue", new SetLightstripColor(lightStrip, 0.87)); + autoChooser.addOption("Make LEDs red", new SetLightstripColor(lightStrip, 0.61)); SmartDashboard.putData("Auto Chooser", autoChooser); configureBindings(); diff --git a/src/main/java/frc/robot/commands/SetLightstripColor.java b/src/main/java/frc/robot/commands/SetLightstripColor.java index bd6bca2..a80d4f8 100644 --- a/src/main/java/frc/robot/commands/SetLightstripColor.java +++ b/src/main/java/frc/robot/commands/SetLightstripColor.java @@ -6,7 +6,7 @@ public class SetLightstripColor extends Command { private LightStrip lightStrip; - private int pattern; + private double pattern; /** * Set the color of the robot's lightstrip @@ -14,7 +14,7 @@ public class SetLightstripColor extends Command { * @param lightStrip The lightstrip you want to use (there should only be ONE) * @param pattern Pattern */ - public SetLightstripColor(LightStrip lightStrip, int pattern) { + public SetLightstripColor(LightStrip lightStrip, double pattern) { this.lightStrip = lightStrip; this.pattern = pattern; } diff --git a/src/main/java/frc/robot/subsystems/LightStrip.java b/src/main/java/frc/robot/subsystems/LightStrip.java index 7e7907b..6b0e0c4 100644 --- a/src/main/java/frc/robot/subsystems/LightStrip.java +++ b/src/main/java/frc/robot/subsystems/LightStrip.java @@ -12,7 +12,7 @@ public class LightStrip extends SubsystemBase { * +1 corresponds to 2000us */ private Spark ledStrip; - private int pattern; + private double pattern; /** * Creates a new LightStrip subsystem. @@ -38,13 +38,14 @@ public LightStrip(int pwmPort) { * @param pattern Pattern ID to use. Consult section 5 of the blinkin manual. * @link https://www.revrobotics.com/content/docs/REV-11-1105-UM.pdf */ - public void setPattern(int pattern) { + public void setPattern(double pattern) { this.pattern = pattern; } @Override public void periodic() { - System.out.println("*** Subsystem setting pattern to pattern number " + pattern); + // System.out.println("*** Subsystem setting pattern to pattern number " + + // pattern); ledStrip.set(pattern); } }