Skip to content

Commit

Permalink
qdded some rqndop m thing
Browse files Browse the repository at this point in the history
  • Loading branch information
EnguerranSorin committed Dec 6, 2023
1 parent b4da06a commit 7f12b4f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/frc/robot/Subsystems/ElevatorSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ public class ElevatorSubsystem extends SubsystemBase {
public ElevatorSubsystem() {

leftMotor = new TalonFX(14);
rightMotor = new TalonFX(15);
rightMotor = new TalonFX(15);<


leftMotor.configFactoryDefault();
rightMotor.configFactoryDefault();

rightMotor.clearStickyFaults();
leftMotor.clearStickyFaults();

rightMotor.follow(leftMotor);

controller = new PIDController(0.4, 0, 0.0125);

Expand Down Expand Up @@ -63,7 +72,7 @@ public void periodic() {
double ticks = leftMotor.getSelectedSensorPosition();
motorPower = controller.calculate(ticksToInches(ticks), targetHeight);
leftMotor.set(TalonFXControlMode.PercentOutput, MathUtil.clamp(motorPower, -0.75, 0.75));
rightMotor.set(TalonFXControlMode.PercentOutput, MathUtil.clamp(motorPower, -0.75, 0.75));

currentHeight = ticksToInches(-leftMotor.getSelectedSensorPosition());
}

Expand Down

0 comments on commit 7f12b4f

Please sign in to comment.