Package com.diozero.api
Class DigitalInputEvent
java.lang.Object
com.diozero.api.Event
com.diozero.api.DeviceEvent
com.diozero.api.DigitalInputEvent
public class DigitalInputEvent extends DeviceEvent
Represents an input event from a digital device.
-
Constructor Summary
Constructors Constructor Description DigitalInputEvent(int gpio, long epochTime, long nanoTime, boolean value)
Constructs an input event from a digital device. -
Method Summary
Methods inherited from class com.diozero.api.DeviceEvent
getGpio
Methods inherited from class com.diozero.api.Event
getEpochTime, getNanoTime
-
Constructor Details
-
DigitalInputEvent
public DigitalInputEvent(int gpio, long epochTime, long nanoTime, boolean value)Constructs an input event from a digital device. See (@link com.diozero.api.DeviceEvent} for first 3 parameters.- Parameters:
gpio
- GPIO numberepochTime
- Unix epoch time: milliseconds elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap secondsnanoTime
- The Java Virtual Machine's high-resolution time source, in nanoseconds (note this is unrelated to epochTime and uses CLOCK_MONOTONIC in the C clock_gettime() function)value
- the event value
-
-
Method Details
-
getValue
public boolean getValue()Returns the underlying GPIO state. Note does not compensate for active high / low.- Returns:
- the physical digital pin state
-
isActive
public boolean isActive()Determine if the event is active or not compensating for active high / low wiring- Returns:
- if the event should be consider active or inactive
-
toString
-