Skip to content

Commit

Permalink
Changing from Talons to SparkMax
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv-0-Arora committed Jan 20, 2024
1 parent 75dccb6 commit a0837b1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import com.ctre.phoenix6.controls.StrictFollower;
import com.ctre.phoenix6.hardware.TalonFX;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkLowLevel.MotorType;

public class ShooterSubsystem extends SubsystemBase {

Expand All @@ -20,22 +20,22 @@ public static ShooterSubsystem getInstance() {
return instance;
}

private TalonFX shooterLeaderM;
private TalonFX shooterFollowerM;
private CANSparkMax m_shooterLeader;
private CANSparkMax m_shooterFollower;

private double voltage;

public ShooterSubsystem() {
shooterLeaderM = new TalonFX(Constants.HardwarePorts.shooterLeaderM);
shooterFollowerM = new TalonFX(Constants.HardwarePorts.shooterFollowerM);
shooterFollowerM.setInverted(true);
shooterFollowerM.setControl(new StrictFollower(Constants.HardwarePorts.shooterLeaderM));
m_shooterLeader = new CANSparkMax(Constants.HardwarePorts.shooterLeaderM, MotorType.kBrushless);
m_shooterFollower = new CANSparkMax(Constants.HardwarePorts.shooterFollowerM, MotorType.kBrushless);
m_shooterFollower.setInverted(true);
m_shooterFollower.follow(m_shooterLeader);
}


public void setVoltage(double voltage) {
this.voltage = voltage;
shooterLeaderM.setVoltage(voltage);
m_shooterLeader.setVoltage(voltage);
}

public double getVoltageSetpoint() {
Expand Down

0 comments on commit a0837b1

Please sign in to comment.