Skip to content

Commit

Permalink
Automated Spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
team5338 committed Nov 30, 2024
1 parent fdf126c commit 350e3d0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static class LauncherConstants {

public static class PneumaticConstants {
public static final int kForwardChannel = 1; // TODO: Update these channel values
public static final int kReverseChannel = 2;
public static final int kReverseChannel = 2;
}

public static class AutoConstants {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ private void configureBindings() {

// m_driverController.rightTrigger().onFalse( new InstantCommand(()->
// {speedUp=0.0;}));
// piston
m_operatorController.b().onTrue(PneumaticCommands.pistonExtend());
m_operatorController.a().onTrue(PneumaticCommands.pistonRetract());
m_operatorController.x().onTrue(PneumaticCommands.solenoidOff());

// piston
m_operatorController.b().onTrue(PneumaticCommands.pistonExtend());
m_operatorController.a().onTrue(PneumaticCommands.pistonRetract());
m_operatorController.x().onTrue(PneumaticCommands.solenoidOff());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/LauncherCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public static Command FeederStop() {
public static Command LauncherStop() {
return new InstantCommand(() -> RobotContainer.m_launcher.setLaunchWheel(0));
}
}
}
28 changes: 12 additions & 16 deletions src/main/java/frc/robot/commands/PneumaticCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
import frc.robot.RobotContainer;

public class PneumaticCommands {
public static Command pistonExtend() {
return new InstantCommand(
() -> RobotContainer.m_piston.extendPiston());
}
public static Command pistonExtend() {
return new InstantCommand(() -> RobotContainer.m_piston.extendPiston());
}

public static Command pistonRetract() {
return new InstantCommand(
() -> RobotContainer.m_piston.retractPiston());
}
public static Command pistonRetract() {
return new InstantCommand(() -> RobotContainer.m_piston.retractPiston());
}

public static Command solenoidOff() {
return new InstantCommand(
() -> RobotContainer.m_piston.setSolenoidOff());
}
public static Command solenoidOff() {
return new InstantCommand(() -> RobotContainer.m_piston.setSolenoidOff());
}

public static Command solenoidToggle() {
return new InstantCommand(
() -> RobotContainer.m_piston.toggleSolenoid());
}
public static Command solenoidToggle() {
return new InstantCommand(() -> RobotContainer.m_piston.toggleSolenoid());
}
}
36 changes: 18 additions & 18 deletions src/main/java/frc/robot/subsystems/Pneumatics.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Pneumatics extends SubsystemBase {
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, PneumaticConstants.kForwardChannel,
PneumaticConstants.kReverseChannel);
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, PneumaticConstants.kForwardChannel,
PneumaticConstants.kReverseChannel);

public Pneumatics() {
setSolenoidOff();
}
public Pneumatics() {
setSolenoidOff();
}

// may want to add a toggle option
public void extendPiston() {
doubleSolenoid.set(DoubleSolenoid.Value.kForward);
}
// may want to add a toggle option
public void extendPiston() {
doubleSolenoid.set(DoubleSolenoid.Value.kForward);
}

public void retractPiston() {
doubleSolenoid.set(DoubleSolenoid.Value.kReverse);
}
public void retractPiston() {
doubleSolenoid.set(DoubleSolenoid.Value.kReverse);
}

public void setSolenoidOff() {
doubleSolenoid.set(DoubleSolenoid.Value.kOff);
}
public void setSolenoidOff() {
doubleSolenoid.set(DoubleSolenoid.Value.kOff);
}

public void toggleSolenoid() {
doubleSolenoid.toggle();
}
public void toggleSolenoid() {
doubleSolenoid.toggle();
}
}

0 comments on commit 350e3d0

Please sign in to comment.