Skip to content

Commit

Permalink
Break LEDs
Browse files Browse the repository at this point in the history
  • Loading branch information
PGgit08 committed Mar 28, 2024
1 parent 9e147ef commit b8210d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/commands/leds/DefaultLED.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public void execute() {

default:
break;

case BRAKE:
_leds.blink(Constants.LEDColors.RED, Constants.LEDColors.NOTHING, 0.1);
break;
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/commands/swerve/BrakeSwerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import frc.robot.Constants;
import frc.robot.subsystems.LEDSubsystem;
import frc.robot.subsystems.SwerveDriveSubsystem;
import frc.robot.subsystems.LEDSubsystem.LEDState;
import frc.robot.utils.UtilFuncs;

/**
* Creates a natural brake on the swerve drive by facing the modules so they
Expand Down Expand Up @@ -47,6 +49,7 @@ public BrakeSwerve(SwerveDriveSubsystem swerveDrive, LEDSubsystem leds, double t
@Override
public void initialize() {
_timer.start();
UtilFuncs.SetLEDs(LEDState.BRAKE);
}

// Called every time the scheduler runs while the command is scheduled.
Expand All @@ -58,13 +61,14 @@ public void execute() {
new SwerveModuleState(0, Rotation2d.fromDegrees(-45))};

_swerveDrive.setStates(states);
_leds.blink(Constants.LEDColors.RED, Constants.LEDColors.NOTHING, 0.2); // TESTING ONLY!!!!!!!
// _leds.blink(Constants.LEDColors.RED, Constants.LEDColors.NOTHING, 0.2); // TESTING ONLY!!!!!!!
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
_timer.stop();
UtilFuncs.SetLEDs((LEDState.DEFAULT));
}

// Returns true when the command should end.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/subsystems/LEDSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class LEDSubsystem extends SubsystemBase {

public enum LEDState {
DEFAULT,
AIM
AIM,
BRAKE
}

/** Creates a new LEDSubsystem. */
Expand Down

0 comments on commit b8210d2

Please sign in to comment.