Package com.revrobotics.sim
Class SparkLimitSwitchSim
java.lang.Object
com.revrobotics.sim.SparkLimitSwitchSim
-
Constructor Summary
ConstructorsConstructorDescriptionSparkLimitSwitchSim(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 TypeMethodDescriptionbooleanGet the enabled state of the limit switchbooleanGet the state of the limit switchvoidsetPressed(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
-