Class CANDigitalInput


  • public class CANDigitalInput
    extends java.lang.Object
    • 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.