Skip to content

Commit 63c4435

Browse files
BrodyKarrTaylerUva
authored andcommitted
made aligning LEDs, and Hopefully None LEDs
1 parent 74321bd commit 63c4435

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757

5858
public final class Constants {
5959
public static class constControllers {
60-
public static final double OPERATOR_RUMBLE = 0.3;
60+
public static final double OPERATOR_RUMBLE = 1;
61+
public static final double DRIVER_RUMBLE = .3;
6162
public static final double DRIVER_LEFT_STICK_DEADBAND = 0.05;
6263
public static final boolean SILENCE_JOYSTICK_WARNINGS = true;
6364
}
@@ -857,9 +858,10 @@ public static class constLED {
857858
LED_CONFIG.brightnessScalar = 1;
858859
}
859860
// LED strip😎
861+
public static final int[] NONE_COLOR = { 0, 0, 255 };
860862
public static final RainbowAnimation NONE_ANIMATION = new RainbowAnimation(MAX_VOLTAGE, MAX_VOLTAGE, 0);
861863
public static final StrobeAnimation READY_TO_SHOOT_ANIMATION = new StrobeAnimation(0, 255, 0, 0, .5, 192);
862-
public static final int[] ALIGNING_ANIMATION = { 255, 255, 0 };
864+
public static final StrobeAnimation ALIGNING_ANIMATION = new StrobeAnimation(255, 0, 0, 0, 0.5, 192);
863865
public static final int[] PREP_CLIMB = { 0, 0, 0 };
864866
public static final int[] CLIMB = { 0, 0, 0 };
865867
public static final int[] PREP_CORAL_ZERO = { 0, 0, 0 };

src/main/java/frc/robot/RobotContainer.java

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public class RobotContainer {
7272
private final Trigger isReadyToScoreReefFeedback = new Trigger(() -> (subDrivetrain.atLastDesiredFieldPosition()
7373
&& subMotion.atLastDesiredMechPosition()));
7474
private final Trigger isReadyToScoreNetFeedback = new Trigger(() -> (subDrivetrain.atLastDesiredFieldPosition()));
75+
private final Trigger isAttemptingAlignFeedback = new Trigger(
76+
() -> (subMotion.atLastDesiredMechPosition() && !subDrivetrain.atLastDesiredFieldPosition()));
7577
private final Trigger hasCoralTrigger = new Trigger(() -> subRotors.hasCoral() && !subRotors.hasAlgae());
7678
private final Trigger hasAlgaeTrigger = new Trigger(() -> !subRotors.hasCoral() && subRotors.hasAlgae());
7779
private final Trigger hasBothTrigger = new Trigger(() -> subRotors.hasCoral() && subRotors.hasAlgae());
@@ -447,6 +449,7 @@ public Command getAutonomousCommand() {
447449
return autoChooser.getSelected();
448450

449451
}
452+
450453
private void configOperatorBindings() {
451454
// Add operator bindings here if needed
452455
conOperator.btn_LeftTrigger
@@ -552,26 +555,32 @@ public void configFeedback() {
552555
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.READY_TO_SHOOT_ANIMATION, 0)))
553556
.whileTrue(
554557
Commands.runOnce(() -> conOperator.setRumble(RumbleType.kBothRumble, constControllers.OPERATOR_RUMBLE)))
558+
.whileTrue(
559+
Commands.runOnce(() -> conDriver.setRumble(RumbleType.kBothRumble, constControllers.DRIVER_RUMBLE)))
555560
.onFalse(Commands.runOnce(() -> conOperator.setRumble(RumbleType.kBothRumble, 0)))
556-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
561+
.onFalse(Commands.runOnce(() -> subLED.setLED(constLED.NONE_COLOR)));
557562
isReadyToScoreNetFeedback
558563
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.READY_TO_SHOOT_ANIMATION, 0)))
559564
.whileTrue(
560565
Commands.runOnce(() -> conOperator.setRumble(RumbleType.kBothRumble, constControllers.OPERATOR_RUMBLE)))
561566
.onFalse(Commands.runOnce(() -> conOperator.setRumble(RumbleType.kBothRumble, 0)))
562-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
563-
isInCSAutoDriveState
564-
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
565-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
566-
isInProcessorAutoDriveState
567-
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
568-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
569-
isInReefAutoDriveLeft
570-
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
571-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
572-
isInReefAutoDriveRight
573-
.onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
574-
.onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
567+
.onFalse(Commands.runOnce(() -> subLED.setLED(constLED.NONE_COLOR)));
568+
isAttemptingAlignFeedback
569+
.whileTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION, 0)))
570+
.onFalse(Commands.runOnce(() -> subLED.setLED(constLED.NONE_COLOR)));
571+
572+
// isInCSAutoDriveState
573+
// .onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
574+
// .onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
575+
// isInProcessorAutoDriveState
576+
// .onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
577+
// .onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
578+
// isInReefAutoDriveLeft
579+
// .onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
580+
// .onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
581+
// isInReefAutoDriveRight
582+
// .onTrue(Commands.runOnce(() -> subLED.setLED(constLED.ALIGNING_ANIMATION)))
583+
// .onFalse(Commands.runOnce(() -> subLED.clearAnimation()));
575584
}
576585

577586
public boolean allZeroed() {

0 commit comments

Comments
 (0)