Adding a way to manage driver control profiles

This commit is contained in:
2025-03-29 16:56:03 -04:00
parent 546fc06aed
commit 5f26dacb31
7 changed files with 157 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
package frc.robot.subsystems;
import java.util.function.DoubleSupplier;
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.FrisbeeShooterWheelsConstants;
import frc.robot.interfaces.ISimpleMotor;
public class FrisbeeShooterWheels extends SubsystemBase implements ISimpleMotor{
private SparkMax frontMotor;
private SparkMax rearMotor;
public FrisbeeShooterWheels() {
frontMotor = new SparkMax(FrisbeeShooterWheelsConstants.kFrontMotorCANID, MotorType.kBrushless);
rearMotor = new SparkMax(FrisbeeShooterWheelsConstants.kRearMotorCANID, MotorType.kBrushless);
}
public Command setSpeed(DoubleSupplier speed) {
return run(() -> {
frontMotor.set(speed.getAsDouble());
rearMotor.set(speed.getAsDouble());
});
}
public Command stop() {
return setSpeed(() -> 0);
}
}