37 lines
801 B
Java
37 lines
801 B
Java
package frc.robot.subsystems;
|
|
|
|
import edu.wpi.first.wpilibj.motorcontrol.VictorSP;
|
|
import edu.wpi.first.wpilibj2.command.Command;
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
|
|
public class Shooter extends SubsystemBase {
|
|
private VictorSP motor1;
|
|
private VictorSP motor2;
|
|
|
|
public Shooter() {
|
|
motor1 = new VictorSP(0);
|
|
motor2 = new VictorSP(0);
|
|
|
|
motor1.addFollower(motor2);
|
|
motor2.setInverted(true);
|
|
}
|
|
|
|
public Command runShooter(double speed) {
|
|
return run(() -> {
|
|
motor1.set(speed);
|
|
});
|
|
}
|
|
|
|
public Command reverseShooter() {
|
|
return run(() -> {
|
|
motor1.set(-1);
|
|
});
|
|
}
|
|
|
|
public Command stopShooter() {
|
|
return run(() -> {
|
|
motor1.set(0);
|
|
});
|
|
}
|
|
}
|