diff --git a/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetIntakeMode.java b/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetIntakeMode.java index 202d1e1..7dffb1e 100644 --- a/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetIntakeMode.java +++ b/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetIntakeMode.java @@ -42,25 +42,15 @@ public SetIntakeMode(HopperSubsystem hopper, IntakeSubsystem intake, ShooterSubs public void initialize() { System.out.println("Setting Intake Mode"); m_hopper.resetBallCount(); - } - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { m_hopper.setIntakeMode(); - m_hopper.intakeOneBall(); m_intake.intakeOn(); m_shooter.shooterOff(); } - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - // Returns true when the command should end. @Override public boolean isFinished() { - return false; + return true; // end after one execution } } diff --git a/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetShootingMode.java b/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetShootingMode.java index fe67782..652db1a 100644 --- a/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetShootingMode.java +++ b/Thunderclap/src/main/java/frc/robot/commands/SetHopperModeCommands/SetShootingMode.java @@ -41,24 +41,15 @@ public SetShootingMode(HopperSubsystem hopper, ShooterSubsystem shooter, IntakeS @Override public void initialize() { System.out.println("Setting Shooter Mode"); - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { + m_hopper.setShootingMode(); m_shooter.shooterOn(); m_intake.intakeOff(); } - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - // Returns true when the command should end. @Override public boolean isFinished() { - return false; + return true; // end after one execution } } diff --git a/Thunderclap/src/main/java/frc/robot/subsystems/HopperSubsystem.java b/Thunderclap/src/main/java/frc/robot/subsystems/HopperSubsystem.java index 7a12f1a..43ee426 100644 --- a/Thunderclap/src/main/java/frc/robot/subsystems/HopperSubsystem.java +++ b/Thunderclap/src/main/java/frc/robot/subsystems/HopperSubsystem.java @@ -60,6 +60,7 @@ public HopperSubsystem(final double stopperForwardSpeed, final double stopperRev // SmartDashboard.putData("Sucker Motor", m_suckerMotor); SmartDashboard.putNumber("Ball Count", m_ballCount); } + public void hopperOn() { m_hopperMotor.set(Constants.kHopperForwardSpeed); m_isHopperOn = true; @@ -155,6 +156,10 @@ public void periodic() { // m_ballSensor.IsBallPresent(); // m_ballOutputSensor.IsBallPresent(); SmartDashboard.putBoolean("Bumper Switch", m_bumperSwitch.get()); + + if (m_hopperMode == HopperMode.intakeMode) { + intakeOneBall(); + } } public void setIntakeMode() {