diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 75869bb..c9984f1 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -91,6 +91,7 @@ public static class MechanismConstants { public static final int FLYWHEEL_MOTOR_2 = 4; public static final boolean FLYWHEEL_MOTOR_1_INVERTED = true; public static final boolean FLYWHEEL_MOTOR_2_INVERTED = false; - public static final double FLYWHEEL_MOTOR_SPEED = 0.8; + public static final double FLYWHEEL_MOTOR_SPEED = 1.0; + public static final double FLYWHEEL_MOTOR_SPEED_SLOW = 0.15; } } diff --git a/src/main/java/frc/robot/commands/FlyWCommand.java b/src/main/java/frc/robot/commands/FlyWCommand.java index c0a7d3e..a6a3375 100644 --- a/src/main/java/frc/robot/commands/FlyWCommand.java +++ b/src/main/java/frc/robot/commands/FlyWCommand.java @@ -28,7 +28,9 @@ public void execute() { m_FlyWSubsystem.enableflywheel(); } else if (FlyWJoystick.getRawButton(7) == true) { m_FlyWSubsystem.reverseflywheel(); - System.out.println("Flywheels Moving in Reverse"); + System.out.println("Conveyor Moving in Reverse"); + } else if (ConveyorJoystick.getRawButton(9) == true) { + m_FlyWSubsystem.enableflywheelslow(); } else { m_FlyWSubsystem.disableflywheel(); } @@ -37,7 +39,6 @@ public void execute() { @Override public void end(boolean interrupted) { m_FlyWSubsystem.disableflywheel(); - m_FlyWSubsystem.enableflywheel(); } @Override diff --git a/src/main/java/frc/robot/subsystems/FlyWheel.java b/src/main/java/frc/robot/subsystems/FlyWheel.java index 2ee2530..df05dae 100644 --- a/src/main/java/frc/robot/subsystems/FlyWheel.java +++ b/src/main/java/frc/robot/subsystems/FlyWheel.java @@ -23,11 +23,17 @@ public FlyWheel() { } /** Sets the flywheel motors to 100% power. */ - public void enableflywheel() { + public void enableflywheelfast() { flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED); flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED); } + /** Sets the flywheel motors to slow speed */ + public void enableflywheelslow() { + flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW); + flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW); + } + /** Sets the flywheel motors to 0% power. */ public void disableflywheel() { flywheelMotor1.set(0); @@ -36,8 +42,8 @@ public void disableflywheel() { /** Sets the flywheel motors to -100% power. (Reverse direction) */ public void reverseflywheel() { - flywheelMotor1.set(-MechanismConstants.FLYWHEEL_MOTOR_SPEED); - flywheelMotor2.set(-MechanismConstants.FLYWHEEL_MOTOR_SPEED); + flywheelMotor1.set(-MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW); + flywheelMotor2.set(-MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW); } @Override