Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitkakkar committed Jan 11, 2024
1 parent 8e057d7 commit 4a1028a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static class VisionHardware {
}

public static class IntakeHardware {
public static final Spark.ID ROLLER_MOTOR_ID = new Spark.ID("IntakeHardware/RollerMotor", 10);
public static final Spark.ID ROLLER_MOTOR_ID = new Spark.ID("IntakeHardware/Roller", 10);
}

public static class SmartDashboard {
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ private void intake(double speed) {
m_rollerMotor.set(speed, ControlType.kDutyCycle, 0.0, ArbFFUnits.kPercentOut);
}

public Command intakeCommand(DoubleSupplier speed) {
return startEnd(() -> intake(speed.getAsDouble()), () -> stop());
}

// Tells the robot to outtake
private void outtake(double speed) {
m_rollerMotor.set(-speed, ControlType.kDutyCycle, 0.0, ArbFFUnits.kPercentOut);
}

public Command outtakeCommand(DoubleSupplier speed) {
return startEnd(() -> outtake(speed.getAsDouble()), () -> stop());
}

// Stop the robot
private void stop() {
m_rollerMotor.stopMotor();;
}

public Command intakeCommand(DoubleSupplier speed) {
return startEnd(() -> intake(speed.getAsDouble()), () -> stop());
}

public Command outtakeCommand(DoubleSupplier speed) {
return startEnd(() -> outtake(speed.getAsDouble()), () -> stop());
}

@Override
public void periodic() {
Expand Down

0 comments on commit 4a1028a

Please sign in to comment.