#include <LimitSwitchConfig.h>
Inherits rev::BaseConfig.
◆ Behavior
Enumerator |
---|
kKeepMovingMotor | |
kStopMovingMotor | |
kKeepMovingMotorAndSetPosition | |
kStopMovingMotorAndSetPosition | |
◆ Type
Enumerator |
---|
kNormallyOpen | |
kNormallyClosed | |
◆ LimitSwitchConfig() [1/3]
rev::spark::LimitSwitchConfig::LimitSwitchConfig |
( |
| ) |
|
|
default |
◆ ~LimitSwitchConfig()
rev::spark::LimitSwitchConfig::~LimitSwitchConfig |
( |
| ) |
|
|
overridedefault |
◆ LimitSwitchConfig() [2/3]
◆ LimitSwitchConfig() [3/3]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Apply()
Applies settings from another LimitSwitchConfig 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
-
- 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()
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()
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
The documentation for this class was generated from the following files: