changed climber limit switch
This commit is contained in:
parent
3f3cb14529
commit
8ac67fcf21
@ -2,6 +2,9 @@ package frc.robot.constants;
|
|||||||
|
|
||||||
public class ClimberPivotConstants {
|
public class ClimberPivotConstants {
|
||||||
public static final int kPivotMotorID = 0;
|
public static final int kPivotMotorID = 0;
|
||||||
|
|
||||||
|
public static final int kClimberLimitSwitchID = 0;
|
||||||
|
|
||||||
public static final double kPIDControllerP = 0;
|
public static final double kPIDControllerP = 0;
|
||||||
public static final double kPIDControllerI = 0;
|
public static final double kPIDControllerI = 0;
|
||||||
public static final double kPIDControllerD = 0;
|
public static final double kPIDControllerD = 0;
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package frc.robot.constants;
|
|
||||||
|
|
||||||
public class ManipulatorConstants {
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package frc.robot.constants;
|
|
||||||
|
|
||||||
public class SensorsConstants {
|
|
||||||
public static final int kClimberLimitSwitchID = 0;
|
|
||||||
}
|
|
@ -5,6 +5,7 @@ import com.revrobotics.spark.SparkMax;
|
|||||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||||
|
|
||||||
import edu.wpi.first.math.controller.PIDController;
|
import edu.wpi.first.math.controller.PIDController;
|
||||||
|
import edu.wpi.first.wpilibj.DigitalInput;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
import frc.robot.constants.ClimberPivotConstants;
|
import frc.robot.constants.ClimberPivotConstants;
|
||||||
@ -14,6 +15,8 @@ public class ClimberPivot extends SubsystemBase {
|
|||||||
|
|
||||||
private AbsoluteEncoder neoEncoder;
|
private AbsoluteEncoder neoEncoder;
|
||||||
|
|
||||||
|
private DigitalInput cageLimitSwitch;
|
||||||
|
|
||||||
private PIDController pidController;
|
private PIDController pidController;
|
||||||
|
|
||||||
public ClimberPivot() {
|
public ClimberPivot() {
|
||||||
@ -25,6 +28,8 @@ public class ClimberPivot extends SubsystemBase {
|
|||||||
|
|
||||||
neoEncoder = pivotMotor.getAbsoluteEncoder();
|
neoEncoder = pivotMotor.getAbsoluteEncoder();
|
||||||
|
|
||||||
|
cageLimitSwitch = new DigitalInput(0);
|
||||||
|
|
||||||
pidController = new PIDController(
|
pidController = new PIDController(
|
||||||
ClimberPivotConstants.kPIDControllerP,
|
ClimberPivotConstants.kPIDControllerP,
|
||||||
ClimberPivotConstants.kPIDControllerI,
|
ClimberPivotConstants.kPIDControllerI,
|
||||||
@ -48,4 +53,8 @@ public class ClimberPivot extends SubsystemBase {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getCageLimitSwitch() {
|
||||||
|
return cageLimitSwitch.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package frc.robot.subsystems;
|
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.DigitalInput;
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
||||||
import frc.robot.constants.SensorsConstants;
|
|
||||||
|
|
||||||
public class Sensors extends SubsystemBase {
|
|
||||||
private DigitalInput climberLimitSwitch;
|
|
||||||
|
|
||||||
public Sensors() {
|
|
||||||
climberLimitSwitch = new DigitalInput(SensorsConstants.kClimberLimitSwitchID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getClimberLimitSwitch() {
|
|
||||||
return climberLimitSwitch.get();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user