Package com.revrobotics.spark.config
Class LimitSwitchConfig
java.lang.Object
com.revrobotics.config.BaseConfig
com.revrobotics.spark.config.LimitSwitchConfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
Nested classes/interfaces inherited from class com.revrobotics.config.BaseConfig
BaseConfig.CANType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(LimitSwitchConfig config) Applies settings from anotherLimitSwitchConfig
to this one.forwardLimitSwitchEnabled
(boolean enabled) Deprecated.forwardLimitSwitchPosition
(double position) Set the triggered position value of the forward limit switch (used when the enable mode is set to kEnabled_SetValueOnTrigger).Set the trigger behavior based on the forward limit switch state.Set the normal state of the forward limit switch.Specifies the feedback sensor that the triggered position value is set on.reverseLimitSwitchEnabled
(boolean enabled) Deprecated.reverseLimitSwitchPosition
(double position) Set the triggered position value of the reverse limit switch (used when the enable mode is set to kEnabled_SetValueOnTrigger).Set the trigger behavior based on the reverse limit switch state.Set the normal state of the reverse limit switch.Configures the data port to use limit switches, which is specifically required for SPARK MAX.Methods inherited from class com.revrobotics.config.BaseConfig
apply, flatten, getParameter, getParameter, putParameter, putParameter, putParameter, removeParameter, removeParameter
-
Constructor Details
-
LimitSwitchConfig
public LimitSwitchConfig()Create a new object to configure a LimitSwitch.
-
-
Method Details
-
apply
Applies settings from anotherLimitSwitchConfig
to this one.Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters:
config
- TheLimitSwitchConfig
to copy settings from- Returns:
- The updated
LimitSwitchConfig
for method chaining
-
setSparkMaxDataPortConfig
Configures the data port to use limit switches, which is specifically required for SPARK MAX.NOTE: This method is only necessary when using limit switches with a SPARK MAX without configuring any of its settings
IMPORTANT: SPARK MAX does not support using limit switches in conjunction with an alternate encoder.
- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
forwardLimitSwitchEnabled
Deprecated.Set whether to enable/disable motor shutdown based on the forward limit switch state. This does not not affect the result of the isPressed() command.- Parameters:
enabled
- True for halting the motor when triggered- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
forwardLimitSwitchTriggerBehavior
Set the trigger behavior based on the forward limit switch state. This does not not affect the result of the isPressed() command.- Parameters:
behavior
- The trigger behavior- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
forwardLimitSwitchType
Set the normal state of the forward limit switch.- Parameters:
type
- kNormallyOpen or kNormallyClosed- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
forwardLimitSwitchPosition
Set the triggered position value of the forward limit switch (used when the enable mode is set to kEnabled_SetValueOnTrigger).- Parameters:
position
- user specified position value- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
reverseLimitSwitchEnabled
Deprecated.Set whether to enable/disable motor shutdown based on the reverse limit switch state. This does not not affect the result of the isPressed() command.- Parameters:
enabled
- True for halting the motor when triggered- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
reverseLimitSwitchTriggerBehavior
Set the trigger behavior based on the reverse limit switch state. This does not not affect the result of the isPressed() command.- Parameters:
behavior
- The trigger behavior- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
reverseLimitSwitchType
Set the normal state of the reverse limit switch.- Parameters:
type
- kNormallyOpen or kNormallyClosed- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
reverseLimitSwitchPosition
Set the triggered position value of the reverse limit switch (used when the enable mode is set to kEnabled_SetValueOnTrigger).- Parameters:
position
- user specified position value- Returns:
- The modified
LimitSwitchConfig
object for method chaining
-
limitSwitchPositionSensor
Specifies the feedback sensor that the triggered position value is set on. This applies for both forward and reverse limit switches.- Parameters:
sensor
- The feedback sensor to set the position value on- Returns:
- The modified LimitSwitchConfig object for method chaining
-
forwardLimitSwitchTriggerBehavior(com.revrobotics.spark.config.LimitSwitchConfig.Behavior)
instead