Skip to content

Commit

Permalink
Drunk man changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ith9 committed Nov 29, 2023
1 parent 4f16e5a commit 330767a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
11 changes: 2 additions & 9 deletions src/main/java/frc/Subsystems/ElevatorSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,13 @@ public boolean nearTargetHeight(){
public void periodic() {
// This method will be called once per scheduler run
motorPower = pidController.calculate(getCurrentHeight());
if (!pidController.atSetpoint()){
if (getCurrentHeight()<5){
left_motor.set(TalonFXControlMode.PercentOutput, -(MathUtil.clamp(motorPower + 0.02, 0, 0.2)));
left_motor.set(TalonFXControlMode.PercentOutput, -(MathUtil.clamp(motorPower + 0.02, -0.5,0.5)));
}
else{
left_motor.set(TalonFXControlMode.PercentOutput, -(MathUtil.clamp(motorPower + 0.02, 0,0.5)));
}
}
// left_motor.set(TalonFXControlMode.PercentOutput, -(0.1));
}


@Override
public void simulationPeriodic() {
// This method will be called once per scheduler run during simulation
}
}
}
17 changes: 4 additions & 13 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,12 @@ public class RobotContainer {
/** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() {


double[] levels = {20d, 15d, 10d, 3d};


for(double i :levels){
targetHeight = i;
}


// Configure the button bindings
configureButtonBindings();
driverA.y().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 20d));
driverA.x().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 15d));
driverA.b().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 10d));
driverA.a().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 3d));
driverA.y().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 20));
driverA.x().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 15));
driverA.b().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 10));
driverA.a().onTrue(new ElevatorBaseCommand(elevatorSubsystem, 3));
}


Expand Down

0 comments on commit 330767a

Please sign in to comment.