Vibrations
This commit is contained in:
parent
ecdde11cd8
commit
40a57eb4cb
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue