Skip to content

Commit fe5416d

Browse files
Converted feed talon to victor spx.
1 parent 1825564 commit fe5416d

File tree

1 file changed

+9
-5
lines changed
  • src/main/java/org/mayheminc/robot2020/subsystems

1 file changed

+9
-5
lines changed

src/main/java/org/mayheminc/robot2020/subsystems/Shooter.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.ctre.phoenix.motorcontrol.*;
77
import com.ctre.phoenix.motorcontrol.ControlMode;
8+
import com.ctre.phoenix.motorcontrol.can.VictorSPX;
89

910
import edu.wpi.first.wpilibj.Timer;
1011
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
@@ -20,7 +21,7 @@ public class Shooter extends SubsystemBase implements PidTunerObject {
2021
private final MayhemTalonSRX shooterWheelRight = new MayhemTalonSRX(Constants.Talon.SHOOTER_WHEEL_RIGHT);
2122
private final MayhemTalonSRX turretTalon = new MayhemTalonSRX(Constants.Talon.SHOOTER_TURRET);
2223
private final MayhemTalonSRX hoodTalon = new MayhemTalonSRX(Constants.Talon.SHOOTER_HOOD);
23-
private final MayhemTalonSRX feederTalon = new MayhemTalonSRX(Constants.Talon.SHOOTER_FEEDER);
24+
private final VictorSPX feederTalon = new VictorSPX(Constants.Talon.SHOOTER_FEEDER);
2425

2526
// private final double MAX_SPEED_RPM = 5760.0;
2627
private final double TALON_TICKS_PER_REV = 2048.0;
@@ -66,10 +67,13 @@ public void init() {
6667
}
6768

6869
private void configureFeederTalon() {
69-
feederTalon.changeControlMode(ControlMode.PercentOutput);
70+
// feederTalon.changeControlMode(ControlMode.PercentOutput);
7071
feederTalon.setNeutralMode(NeutralMode.Brake);
71-
feederTalon.configNominalOutputVoltage(+0.0f, -0.0f);
72-
feederTalon.configPeakOutputVoltage(+6.0, -6.0);
72+
73+
feederTalon.configNominalOutputForward(+0.0f);
74+
feederTalon.configNominalOutputReverse(0.0);
75+
feederTalon.configPeakOutputForward(+6.0);
76+
feederTalon.configPeakOutputReverse(-6.0);
7377
}
7478

7579
private void configureHoodTalon() {
@@ -198,7 +202,7 @@ private void UpdateDashboard() {
198202
SmartDashboard.putNumber("Shooter turret velocity", turretTalon.getSelectedSensorVelocity(0));
199203

200204
SmartDashboard.putNumber("Shooter hood pos", hoodTalon.getPosition());
201-
SmartDashboard.putNumber("Shooter feeder speed", feederTalon.getPosition());
205+
SmartDashboard.putNumber("Shooter feeder speed", feederTalon.getMotorOutputVoltage());
202206

203207
// SmartDashboard.putNumber("Shooter Debug", debugShooter++);
204208
}

0 commit comments

Comments
 (0)