The shooter subsystem is much simpler than the drive system of a swerve drive motor. Basically you have one motor which spins and shoots the ball. You will need to control the speed of this motor via a PID loop.
You can find the pin numbers you need for the shooter motor’s PWMMotor and Encoder in the Swerve class:
1 2 3 4 5 |
Swerve.ShooterI2CAddr - Specifies the I2C address for the Shooter motor Swerve.ShooterPWM - Specifies the PWM pin for the Shooter motor Swerve.ShooterDIR - Specifies the DIR pin for the Shooter motor Swerve.ShooterEncInt - Specifies the INT pin for the Shooter encoder Swerve.ShooterEncDir - Specifies the DIR pin for the Shooter encoder |
In tuned my shooter at 90% full speed and here is my result:

And my final PID values were:
1 2 3 4 5 |
public static final double k_maxSpeed = 1600; public static final double k_f = 1.0 / k_maxSpeed; public static final double k_p = 0.002; public static final double k_i = 0.0005; public static final double k_iZone = 50; |
You should create a SpinupCommand which you can use to start the spinner in preparation for shooting.