Class DigitalInput

  • All Implemented Interfaces:
    Sendable, AutoCloseable

    public class DigitalInput
    extends DigitalSource
    Class to read a digital input. This class will read digital inputs and return the current value on the channel. Other devices such as encoders, gear tooth sensors, etc. that are implemented elsewhere will automatically allocate digital inputs and outputs as required. This class is only for devices like switches etc. that aren't implemented anywhere else.
    • Constructor Detail

      • DigitalInput

        public DigitalInput​(int channel)
        Create an instance of a Digital Input class. Creates a digital input given a channel.
        channel - the DIO channel for the digital input 0-9 are on-board, 10-25 are on the MXP
    • Method Detail

      • get

        public boolean get()
        Get the value from a digital input channel. Retrieve the value of a single digital input channel from the FPGA.
        the status of the digital input
      • getChannel

        public int getChannel()
        Get the channel of the digital input.
        Specified by:
        getChannel in class DigitalSource
        The GPIO channel number that this object represents.
      • isAnalogTrigger

        public boolean isAnalogTrigger()
        Is this an analog trigger.
        Specified by:
        isAnalogTrigger in class DigitalSource
        true if this is an analog trigger
      • initSendable

        public void initSendable​(SendableBuilder builder)
        Description copied from interface: Sendable
        Initializes this Sendable object.
        builder - sendable builder