Skip to content

Commit

Permalink
Allow forward and reverse limit switches to be enabled/disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
viggy96 committed Dec 20, 2023
1 parent 9fbf970 commit a060808
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/org/lasarobotics/hardware/SparkMax.java
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,34 @@ public void resetEncoder() {
System.out.println(String.join(" ", m_id.name, "Encoder reset!"));
}

/**
* Disable forward limit switch
*/
public void disableForwardLimitSwitch() {
getForwardLimitSwitch().enableLimitSwitch(false);
}

/**
* Enable forward limit switch
*/
public void enableForwardLimitSwitch() {
getForwardLimitSwitch().enableLimitSwitch(true);
}

/**
* Disable reverse limit switch
*/
public void disableReverseLimitSwitch() {
getReverseLimitSwitch().enableLimitSwitch(false);
}

/**
* Enable reverse limit switch
*/
public void enableReverseLimitSwitch() {
getReverseLimitSwitch().enableLimitSwitch(true);
}

/**
* Enable PID wrapping for closed loop position control
* @param minInput Value of the min input for position
Expand Down

0 comments on commit a060808

Please sign in to comment.