Package com.revrobotics
Class CANDigitalInput
- java.lang.Object
-
- com.revrobotics.CANDigitalInput
-
public class CANDigitalInput extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CANDigitalInput.LimitSwitch
static class
CANDigitalInput.LimitSwitchPolarity
-
Constructor Summary
Constructors Constructor Description CANDigitalInput(CANSparkMax device, CANDigitalInput.LimitSwitch limitSwitch, CANDigitalInput.LimitSwitchPolarity polarity)
Constructs a CANDigitalInput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CANError
enableLimitSwitch(boolean enable)
Enables or disables controller shutdown based on limit switch.boolean
get()
Get the value from a digital input channel.boolean
isLimitSwitchEnabled()
Returns true if limit switch is enabled.
-
-
-
Constructor Detail
-
CANDigitalInput
public CANDigitalInput(CANSparkMax device, CANDigitalInput.LimitSwitch limitSwitch, CANDigitalInput.LimitSwitchPolarity polarity)
Constructs a CANDigitalInput.- Parameters:
device
- The Spark Max to which the limit switch is attached.limitSwitch
- Whether this is forward or reverse limit switch.polarity
- Whether the limit switch is normally open or normally closed.
-
-
Method Detail
-
get
public boolean get()
Get the value from a digital input channel. Retrieve the value of a single digital input channel from a motor controller. This method will return the state of the limit input based on the selected polarity, whether or not it is enabled.
-
enableLimitSwitch
public CANError enableLimitSwitch(boolean enable)
Enables or disables controller shutdown based on limit switch.
-
isLimitSwitchEnabled
public boolean isLimitSwitchEnabled()
Returns true if limit switch is enabled.
-
-