Skip to content

Commit

Permalink
Fixed Conveyor Direction
Browse files Browse the repository at this point in the history
STILL NEEDS REVIEW WITH BOTH BELTS FUNCTIONAL! But it seems that the problem is fixed.
  • Loading branch information
OakvilleDynamicsProgrammer committed Mar 9, 2024
1 parent a35a082 commit 5f8df64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/main/java/frc/robot/commands/ConveyorCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ public void initialize() {}
@Override
public void execute() {
if (ConveyorJoystick.getRawButton(5) == true | ConveyorJoystick.getRawButton(3) == true) {
m_ConveyorSubsystem.enableConveyor();
} else if (ConveyorJoystick.getRawButton(6) == true | ConveyorJoystick.getRawButton(4)) {
m_ConveyorSubsystem.intakeConveyor();
} else if (ConveyorJoystick.getRawButton(6) == true
| ConveyorJoystick.getRawButton(4) == true) {
m_ConveyorSubsystem.reverseConveyor();
System.out.println("Conveyor Moving in Reverse");
} else {
Expand All @@ -38,7 +39,7 @@ public void execute() {
@Override
public void end(boolean interrupted) {
m_ConveyorSubsystem.disableConveyor();
m_ConveyorSubsystem.enableConveyor();
m_ConveyorSubsystem.intakeConveyor();
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/subsystems/Conveyor.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public Conveyor() {
}

/** Sets the Conveyor motors to 100% power. */
public void enableConveyor() {
conveyorMotor1.set(MechanismConstants.CONVEYOR_MOTOR_SPEED);
conveyorMotor2.set(MechanismConstants.CONVEYOR_MOTOR_SPEED);
public void intakeConveyor() {
conveyorMotor1.set(-MechanismConstants.CONVEYOR_MOTOR_SPEED);
conveyorMotor2.set(-MechanismConstants.CONVEYOR_MOTOR_SPEED);
}

/** Sets the Conveyor motors to 0% power. */
Expand All @@ -36,8 +36,8 @@ public void disableConveyor() {

/** Sets the Conveyor motors to -100% power. (Reverse direction) */
public void reverseConveyor() {
conveyorMotor1.set(-MechanismConstants.CONVEYOR_MOTOR_SPEED);
conveyorMotor2.set(-MechanismConstants.CONVEYOR_MOTOR_SPEED);
conveyorMotor1.set(MechanismConstants.CONVEYOR_MOTOR_SPEED);
conveyorMotor2.set(MechanismConstants.CONVEYOR_MOTOR_SPEED);
}

@Override
Expand Down

0 comments on commit 5f8df64

Please sign in to comment.