-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj.XboxController; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.drive.Drivetrain; | ||
|
||
/** | ||
* Drive. | ||
*/ | ||
|
||
public class Drive extends Command { | ||
private XboxController controller; | ||
private Drivetrain drive; | ||
|
||
/** | ||
* Drive again. | ||
*/ | ||
|
||
public Drive(Drivetrain drive, XboxController controller) { | ||
this.controller = controller; | ||
this.drive = drive; | ||
addRequirements(drive); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
double leftY = (Math.abs(controller.getLeftY()) < .05) ? 0 : controller.getLeftY(); | ||
double rightY = (Math.abs(controller.getRightY()) < .05) ? 0 : controller.getRightY(); | ||
this.drive.setPower(leftY, rightY); | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package frc.robot.subsystems.intake; | ||
|
||
public class intake { | ||
Check warning on line 3 in src/main/java/frc/robot/subsystems/intake/intake.java GitHub Actions / Linting
Check warning on line 3 in src/main/java/frc/robot/subsystems/intake/intake.java GitHub Actions / Linting
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package frc.robot.subsystems.intake; | ||
|
||
import org.littletonrobotics.junction.AutoLog; | ||
|
||
public interface intakeIO { | ||
Check warning on line 5 in src/main/java/frc/robot/subsystems/intake/intakeIO.java GitHub Actions / Linting
Check warning on line 5 in src/main/java/frc/robot/subsystems/intake/intakeIO.java GitHub Actions / Linting
|
||
|
||
@AutoLog | ||
Check warning on line 7 in src/main/java/frc/robot/subsystems/intake/intakeIO.java GitHub Actions / Linting
|
||
public static class intakeIOInputs { | ||
Check warning on line 8 in src/main/java/frc/robot/subsystems/intake/intakeIO.java GitHub Actions / Linting
|
||
public double rightMotor; | ||
public double leftMotor; | ||
} | ||
|
||
/** Updates the set of loggable inputs. */ | ||
|
||
public default void intakePower(double lvolts, double rvolts) {} | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package frc.robot.subsystems.intake; | ||
|
||
import edu.wpi.first.wpilibj.motorcontrol.VictorSP; | ||
|
||
public class intakeReal implements intakeIO { | ||
Check warning on line 5 in src/main/java/frc/robot/subsystems/intake/intakeReal.java GitHub Actions / Linting
Check warning on line 5 in src/main/java/frc/robot/subsystems/intake/intakeReal.java GitHub Actions / Linting
|
||
VictorSP leftIntake = new VictorSP(frc.robot.Constants.Motors.IntakeMotors.LMOTOR); | ||
VictorSP rightIntake = new VictorSP(frc.robot.Constants.Motors.IntakeMotors.RMOTOR); | ||
|
||
public intakeReal() { | ||
rightIntake.setInverted(true); | ||
} | ||
|
||
|
||
public void intakeVoltage(double lvolts, double rvolts) { | ||
leftIntake.set(lvolts); | ||
rightIntake.set(rvolts); | ||
} | ||
|
||
} | ||
|