Skip to content

Commit

Permalink
Use new Akit'ed limit switches
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGilb committed Feb 16, 2024
1 parent a87c674 commit 8de948e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/java/competition/subsystems/arm/ArmSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ public ArmSubsystem(PropertyFactory pf, XCANSparkMax.XCANSparkMaxFactory sparkMa
this.getPrefix() + "ArmEncoder",
contract.getArmEncoderInverted());

armMotorLeft.setSmartCurrentLimit(20);
armMotorRight.setSmartCurrentLimit(20);

// Enable hardware limits
armMotorLeft.setForwardLimitSwitch(SparkLimitSwitch.Type.kNormallyOpen, true);
armMotorLeft.setReverseLimitSwitch(SparkLimitSwitch.Type.kNormallyOpen, true);
Expand Down Expand Up @@ -274,8 +277,8 @@ public LimitState getLimitState(XCANSparkMax motor) {
boolean lowerHit = false;

if (contract.isArmReady()) {
upperHit = motor.getForwardLimitSwitchPressed(SparkLimitSwitch.Type.kNormallyOpen);
lowerHit = motor.getReverseLimitSwitchPressed(SparkLimitSwitch.Type.kNormallyOpen);
upperHit = motor.getForwardLimitSwitchPressed();
lowerHit = motor.getReverseLimitSwitchPressed();
}

if (upperHit && lowerHit) {
Expand Down

0 comments on commit 8de948e

Please sign in to comment.