diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 1cd86d1..b459ee4 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -87,7 +87,7 @@ public class RobotContainer { // m_driverController.x().toggleOnTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem)); m_driverController.a().whileTrue(new AutoTurretShootCommand(hopperSubsystem, turretSubsystem, intakeSubsystem, driveSubsystem)); m_driverController.x().whileTrue(new AutoTurretShootCommand(hopperSubsystem, turretSubsystem, intakeSubsystem, driveSubsystem)); - m_driverController.b().whileTrue(new Reverse(intakeSubsystem, hopperSubsystem)); + m_driverController.b().whileTrue(new Reverse(intakeSubsystem, hopperSubsystem, m_driverController.getHID())); m_driverController.y().onTrue(intakeSubsystem.deploy()); } diff --git a/src/main/java/frc/robot/commands/Reverse.java b/src/main/java/frc/robot/commands/Reverse.java index d2a7425..d42a108 100644 --- a/src/main/java/frc/robot/commands/Reverse.java +++ b/src/main/java/frc/robot/commands/Reverse.java @@ -3,6 +3,7 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; +import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import frc.robot.subsystems.HopperSubsystem; import frc.robot.subsystems.IntakeSubsystem; @@ -14,15 +15,17 @@ public class Reverse extends Command { private IntakeSubsystem intakeSubsystem; private HopperSubsystem hopperSubsystem; + private XboxController m_XboxController; /** * Creates a new ExampleCommand. * * @param subsystem The subsystem used by this command. */ - public Reverse(IntakeSubsystem intakeSubsystem, HopperSubsystem hopperSubsystem) { + public Reverse(IntakeSubsystem intakeSubsystem, HopperSubsystem hopperSubsystem, XboxController m_XboxController) { this.intakeSubsystem = intakeSubsystem; this.hopperSubsystem = hopperSubsystem; + this.m_XboxController = m_XboxController; } // Called when the command is initially scheduled. @@ -43,7 +46,7 @@ public class Reverse extends Command { public void end(boolean interrupted) { hopperSubsystem.stopKicker(); hopperSubsystem.spindexerOff(); - intakeSubsystem.stopIntake(); + intakeSubsystem.stopIntake(m_XboxController); } // Returns true when the command should end. diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 2d49c8f..a9042a6 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -60,9 +60,10 @@ public class IntakeSubsystem extends TestableSubsystem { intakeMotor.set(speed); } - public Command stopIntake() { + public Command stopIntake(XboxController m_XboxController) { return this.runOnce(() -> { intakeMotor.stopMotor(); + m_XboxController.setRumble(RumbleType.kBothRumble, .0); }); }