Class AsyncDigitalInput

    • Constructor Detail

      • AsyncDigitalInput

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

      • checkForUpdates

        public void checkForUpdates()
        Description copied from interface: Pollable
        Check for, and handle any updates since the last call. This should only be called from the Poller
        Specified by:
        checkForUpdates in interface Pollable
      • registerTriggerCallback

        public void registerTriggerCallback​(java.lang.Runnable callback)
        Register a callback function to be run when the input is pulled high
        Parameters:
        callback - Callback function
      • registerReleaseCallback

        public void registerReleaseCallback​(java.lang.Runnable callback)
        Register a callback function to be run when the input is pulled low
        Parameters:
        callback - Callback function
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class DigitalInput