Skip to content

Commit

Permalink
Merge pull request #29 from OakvilleDynamics/Intake/Remap-Buttons
Browse files Browse the repository at this point in the history
Remapped Buttons Finalization
  • Loading branch information
garrettsummerfi3ld committed Mar 12, 2024
2 parents d0bee59 + 9be43bc commit 4e4dccf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
6 changes: 2 additions & 4 deletions src/main/java/frc/robot/commands/ConveyorCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
public class ConveyorCommand extends Command {
private final Conveyor m_ConveyorSubsystem;
// controller
// TODO: Change this to the correct controller
private final Joystick ConveyorJoystick = new Joystick(OperatorConstants.COPILOT_CONTROLLER);

public ConveyorCommand(Conveyor subsystem) {
Expand All @@ -25,10 +24,9 @@ public void initialize() {}

@Override
public void execute() {
if (ConveyorJoystick.getRawButton(5) == true | ConveyorJoystick.getRawButton(3) == true) {
if (ConveyorJoystick.getRawButton(5 | 3 | 10)) {
m_ConveyorSubsystem.intakeConveyor();
} else if (ConveyorJoystick.getRawButton(6) == true
| ConveyorJoystick.getRawButton(4) == true) {
} else if (ConveyorJoystick.getRawButton(6 | 4 | 9)) {
m_ConveyorSubsystem.reverseConveyor();
System.out.println("Conveyor Moving in Reverse");
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/ElevatorControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if (ElevatorJoystick.getThrottle() <= -0.85) {
if (ElevatorJoystick.getThrottle() <= -0.75) {
ElevatorSubsystem.up();
} else if (ElevatorJoystick.getThrottle() >= 0.85) {
} else if (ElevatorJoystick.getThrottle() >= 0.75) {
ElevatorSubsystem.down();
}
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/frc/robot/commands/FlyWCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ public void initialize() {}

@Override
public void execute() {
if (FlyWJoystick.getPOV() == 315 | FlyWJoystick.getPOV() == 0 | FlyWJoystick.getPOV() == 45) {
if (FlyWJoystick.getPOV() == (315 | 0 | 45)) {

Check warning on line 28 in src/main/java/frc/robot/commands/FlyWCommand.java

View workflow job for this annotation

GitHub Actions / qodana

Pointless bitwise expression

`315 | 0 | 45` can be replaced with '315 \| 45'
m_FlyWSubsystem.enableflywheelfull();
} else if (FlyWJoystick.getPOV() == 225
| FlyWJoystick.getPOV() == 180
| FlyWJoystick.getPOV() == 135) {
} else if (FlyWJoystick.getPOV() == (225 | 180 | 135)) {
m_FlyWSubsystem.enableflywheellow();
} else if (FlyWJoystick.getRawButton(12) == true) {
} else if (FlyWJoystick.getRawButton(12)) {
m_FlyWSubsystem.enableflywheelreduced();
} else if (FlyWJoystick.getRawButton(7) == true) {
} else if (FlyWJoystick.getRawButton(11 | 7)) {
m_FlyWSubsystem.reverseflywheel();
System.out.println("Flywheels Moving in Reverse");
} else {
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/commands/IntakeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ public void initialize() {}

@Override
public void execute() {
if (IntakeJoystick.getRawButton(5) == true) {
// sushi in
if (IntakeJoystick.getRawButton(5)) {
// sushi + Conveyor in
m_intakeSubsystem.enableIntakeSushi();
} else if (IntakeJoystick.getRawButton(3) == true) {
// front in
} else if (IntakeJoystick.getRawButton(3)) {
// front + Conveyor in
m_intakeSubsystem.enableIntakeFront();
} else if (IntakeJoystick.getRawButton(4) == true) {
// front out
} else if (IntakeJoystick.getRawButton(4)) {
// front + Conveyor out
m_intakeSubsystem.reverseIntakeFront();
System.out.println("Front Rollers Moving in Reverse");
} else if (IntakeJoystick.getRawButton(6) == true) {
// sushi out
} else if (IntakeJoystick.getRawButton(6)) {
// sushi + Conveyor out
m_intakeSubsystem.reverseIntakeSushi();
System.out.println("Sushi Rollers Moving in Reverse");
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public void enableIntakeFront() {
intakeFront.set(MechanismConstants.INTAKE_MOTOR_SPEED_FRONT);
}

/** Sets the intake motors to 0% power. */
/** Sets both intake motors to 0% power. */
public void disableIntake() {
intakeSushi.set(0);
intakeFront.set(0);
}

/** Sets the intake motors to -100% power. (Reverse direction) */
/** Sets the sushi motors to -100% power. (Reverse direction) */
public void reverseIntakeSushi() {
intakeSushi.set(-MechanismConstants.INTAKE_MOTOR_SPEED_SUSHI);
}
Expand Down

0 comments on commit 4e4dccf

Please sign in to comment.