Skip to content

Commit

Permalink
Flywheels remapped
Browse files Browse the repository at this point in the history
Upwards to the 45s and center is temporarily set to reduced speed until they clear to go full/adjusted speed.
Downwards is 15% speed (center and 45s). Button 7 is reverse (reverse is set to 15% speed).
  • Loading branch information
EuphoniumPlayer committed Mar 6, 2024
1 parent bb11261 commit 100b174
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ 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 = 1.0;
public static final double FLYWHEEL_MOTOR_FULL_SPEED = 1.0;
public static final double FLYWHEEL_MOTOR_REDUCED_SPEED = 0.65;
public static final double FLYWHEEL_MOTOR_SPEED_SLOW = 0.15;
}
}
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/commands/FlyWCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public void initialize() {}

@Override
public void execute() {
if (FlyWJoystick.getPOV() != -1) {
m_FlyWSubsystem.enableflywheel();
if (FlyWJoystick.getPOV() == 215 | FlyWJoystick.getPOV() == 0 | FlyWJoystick.getPOV() == 45) {
m_FlyWSubsystem.enableflywheelreduced();
} else if (FlyWJoystick.getPOV() == 225 | FlyWJoystick.getPOV() == 180 | FlyWJoystick.getPOV() == 135) {
m_FlyWSubsystem.enableflywheelslow();
} else if (FlyWJoystick.getRawButton(7) == true) {
m_FlyWSubsystem.reverseflywheel();
System.out.println("Conveyor Moving in Reverse");
} else if (ConveyorJoystick.getRawButton(9) == true) {
m_FlyWSubsystem.enableflywheelslow();
System.out.println("Flywheels Moving in Reverse");
} else {
m_FlyWSubsystem.disableflywheel();
}
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/frc/robot/subsystems/FlyWheel.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ public FlyWheel() {
}

/** Sets the flywheel motors to 100% power. */
public void enableflywheelfast() {
flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED);
flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED);
public void enableflywheelfull() {
flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_FULL_SPEED);
flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_FULL_SPEED);
}

/** Sets the flywheel motors to slow speed */
/** Sets the flywheel speed to 65% power. */
public void enableflywheelreduced() {
flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_REDUCED_SPEED);
flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_REDUCED_SPEED);
}

/** Sets the flywheel motors to 15% */
public void enableflywheelslow() {
flywheelMotor1.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW);
flywheelMotor2.set(MechanismConstants.FLYWHEEL_MOTOR_SPEED_SLOW);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public Intake() {
/** Sets the sushi motors to 100% power. */
public void enableIntakeSushi() {
intakeSushi.set(MechanismConstants.INTAKE_MOTOR_SPEED_SUSHI);
//intakeFront.set(MechanismConstants.INTAKE_MOTOR_SPEED_FRONT);
// intakeFront.set(MechanismConstants.INTAKE_MOTOR_SPEED_FRONT);
}

/** Sets the front intake motors to 100% power. */
public void enableIntakeFront() {
intakeFront.set(MechanismConstants.INTAKE_MOTOR_SPEED_FRONT);
Expand All @@ -54,6 +54,7 @@ public void reverseIntakeSushi() {
public void reverseIntakeFront() {
intakeFront.set(-MechanismConstants.INTAKE_MOTOR_SPEED_FRONT);
}

@Override
public void periodic() {
// This method will be called once per scheduler run
Expand Down

0 comments on commit 100b174

Please sign in to comment.