Class DebouncedDigitalInputDevice

All Implemented Interfaces:
DeviceInterface, DigitalInputDeviceInterface, DeviceEventConsumer<DigitalInputEvent>, AutoCloseable, Consumer<DigitalInputEvent>

public class DebouncedDigitalInputDevice
extends WaitableDigitalInputDevice
Represents a generic input device with typical on/off behaviour. This class extends 'WaitableInputDevice' with machinery to fire the active and inactive events for devices that operate in a typical digital manner: straight forward on / off states with (reasonably) clean transitions between the two.
  • Constructor Details

    • DebouncedDigitalInputDevice

      public DebouncedDigitalInputDevice​(int gpio) throws RuntimeIOException
      Throws:
      RuntimeIOException
    • DebouncedDigitalInputDevice

      public DebouncedDigitalInputDevice​(int gpio, GpioPullUpDown pud, float debounceTime) throws RuntimeIOException
      Parameters:
      gpio - GPIO
      pud - Pull-up/down configuratoin
      debounceTime - Specifies the length of time (in seconds) that the component will ignore changes in state after an initial change. This defaults to 0 which indicates that no bounce compensation will be performed.
      Throws:
      RuntimeIOException - if an I/O error occurs
    • DebouncedDigitalInputDevice

      public DebouncedDigitalInputDevice​(int gpio, GpioPullUpDown pud, float debounceTime, GpioEventTrigger trigger) throws RuntimeIOException
      Throws:
      RuntimeIOException
  • Method Details

    • setDebounceTime

      public void setDebounceTime​(float debounceTime)