Class LimitSwitch

  • All Implemented Interfaces:
    edu.wpi.first.util.sendable.Sendable, java.lang.AutoCloseable

    public class LimitSwitch
    extends edu.wpi.first.wpilibj.DigitalInput
    Shortcut wrapper around the WPI DigitalInput class for a Digital I/O-configured Limit Switch.
    • Constructor Summary

      Constructors 
      Constructor Description
      LimitSwitch​(int channel)
      Create an instance of a LimitSwitch class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isEngaged()
      Same as get(), but it's a bit more clearer on the physical result of the limit switch being pressed and engaged, or not.
      • Methods inherited from class edu.wpi.first.wpilibj.DigitalInput

        close, get, getAnalogTriggerTypeForRouting, getChannel, getPortHandleForRouting, initSendable, isAnalogTrigger, setSimDevice
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LimitSwitch

        public LimitSwitch​(int channel)
        Create an instance of a LimitSwitch class. Creates a digital input given a channel.
        Parameters:
        channel - the DIO channel for the digital input
    • Method Detail

      • isEngaged

        public boolean isEngaged()
        Same as get(), but it's a bit more clearer on the physical result of the limit switch being pressed and engaged, or not.
        Returns:
        If the switch is engaged or not.