Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
[Spotless] Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettsummerfi3ld committed Jan 28, 2024
1 parent 3b46adb commit 41136f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/commands/IntakeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

public class IntakeCommand extends Command {
private final Intake m_intakeSubsystem;
//controller
// controller
// TODO: Change this to the correct controller
private final Joystick IntakeJoystick = new Joystick(1);

public IntakeCommand(Intake subsystem) {
m_intakeSubsystem = subsystem;
addRequirements(m_intakeSubsystem);
Expand All @@ -26,7 +27,7 @@ public void execute() {
// TODO: Change this to the correct button
if (IntakeJoystick.getRawButton(3) == true) {

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

View workflow job for this annotation

GitHub Actions / qodana

Pointless boolean expression

`IntakeJoystick.getRawButton(3) == true` can be simplified to 'IntakeJoystick.getRawButton(3)'
m_intakeSubsystem.enableIntake();
// TODO: Change this to the correct button
// TODO: Change this to the correct button
} else if (IntakeJoystick.getRawButton(4) == true) {

Check warning on line 31 in src/main/java/frc/robot/commands/IntakeCommand.java

View workflow job for this annotation

GitHub Actions / qodana

Pointless boolean expression

`IntakeJoystick.getRawButton(4) == true` can be simplified to 'IntakeJoystick.getRawButton(4)'
m_intakeSubsystem.reverseIntake();
System.out.println("Intake Moving in Reverse");
Expand Down
21 changes: 8 additions & 13 deletions src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,37 @@

package frc.robot.subsystems;

import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkLowLevel;

import com.revrobotics.CANSparkMax;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.MechanismConstants;

public class Intake extends SubsystemBase {

private final CANSparkMax intakeMotor1 = new CANSparkMax(MechanismConstants.INTAKE_MOTOR_1, CANSparkLowLevel.MotorType.kBrushless);
private final CANSparkMax intakeMotor2 = new CANSparkMax(MechanismConstants.INTAKE_MOTOR_2, CANSparkLowLevel.MotorType.kBrushless);
private final CANSparkMax intakeMotor1 =
new CANSparkMax(MechanismConstants.INTAKE_MOTOR_1, CANSparkLowLevel.MotorType.kBrushless);
private final CANSparkMax intakeMotor2 =
new CANSparkMax(MechanismConstants.INTAKE_MOTOR_2, CANSparkLowLevel.MotorType.kBrushless);

/** Creates a new Intake. */
public Intake() {
intakeMotor1.setInverted(MechanismConstants.INTAKE_MOTOR_1_INVERTED);
intakeMotor2.setInverted(MechanismConstants.INTAKE_MOTOR_2_INVERTED);
}

/**
* Sets the intake motors to 100% power.
*/
/** Sets the intake motors to 100% power. */
public void enableIntake() {
intakeMotor1.set(MechanismConstants.INTAKE_MOTOR_SPEED);
intakeMotor2.set(MechanismConstants.INTAKE_MOTOR_SPEED);
}

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

/**
* Sets the intake motors to -100% power. (Reverse direction)
*/
/** Sets the intake motors to -100% power. (Reverse direction) */
public void reverseIntake() {
intakeMotor1.set(-MechanismConstants.INTAKE_MOTOR_SPEED);
intakeMotor2.set(-MechanismConstants.INTAKE_MOTOR_SPEED);
Expand Down

0 comments on commit 41136f8

Please sign in to comment.