Package com.revrobotics.sim
Class SparkLimitSwitchSim
java.lang.Object
com.revrobotics.sim.SparkLimitSwitchSim
-
Constructor Summary
ConstructorDescriptionSparkLimitSwitchSim
(SparkFlex motor, boolean forward) Create a Limit Switch simulation object for a Spark Flex.SparkLimitSwitchSim
(SparkMax motor, boolean forward) Create a Limit Switch simulation object for a Spark MAX. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the enabled state of the limit switchboolean
Get the state of the limit switchvoid
setPressed
(boolean state) Set the state of the limit switch
-
Constructor Details
-
SparkLimitSwitchSim
Create a Limit Switch simulation object for a Spark MAX. This will allow you to read/write data from the simulated sensor and view it in the Sim GUI.- Parameters:
motor
- The CANSparkMax associated with the sensorforward
- if the switch is forward or not
-
SparkLimitSwitchSim
Create a Limit Switch simulation object for a Spark Flex. This will allow you to read/write data from the simulated sensor and view it in the Sim GUI.- Parameters:
motor
- The CANSparkMax associated with the sensorforward
- if the switch is forward or not
-
-
Method Details
-
setPressed
public void setPressed(boolean state) Set the state of the limit switch- Parameters:
state
- if the switch is pressed or not
-
getPressed
public boolean getPressed()Get the state of the limit switch- Returns:
- if the switch is pressed or not
-
getEnabled
public boolean getEnabled()Get the enabled state of the limit switchEnable the limit switch via the original SparkLimitSwitch object
- Returns:
- if the switch is enabled or not
-