Package com.pi4j.wiringpi
Class GpioInterruptEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.pi4j.wiringpi.GpioInterruptEvent
-
- All Implemented Interfaces:
Serializable
public class GpioInterruptEvent extends EventObject
This class provides the event object for GPIO interrupt state changes. Before using the Pi4J library, you need to ensure that the Java VM in configured with access to the following system libraries:
- pi4j
- wiringPi
This library depends on the wiringPi native system library. (developed by Gordon Henderson @ http://wiringpi.com/)
- Author:
- Robert Savage (http://www.savagehomeautomation.com)
- See Also:
- https://pi4j.com/, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description GpioInterruptEvent(Object obj, int pin, boolean state)
Default event constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPin()
Get the pin number that changed and raised this event.boolean
getState()
Get the new pin state raised in this event.int
getStateValue()
Get the new pin state value raised in this event.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
GpioInterruptEvent
public GpioInterruptEvent(Object obj, int pin, boolean state)
Default event constructor
- Parameters:
obj
- Ignore this parameterpin
- GPIO pin number (not header pin number; not wiringPi pin number)state
- New GPIO pin state.
-
-
Method Detail
-
getPin
public int getPin()
Get the pin number that changed and raised this event.- Returns:
- GPIO pin number (not header pin number; not wiringPi pin number)
-
getState
public boolean getState()
Get the new pin state raised in this event.- Returns:
- GPIO pin state (HIGH=true, LOW=false)
-
getStateValue
public int getStateValue()
Get the new pin state value raised in this event.- Returns:
- GPIO pin state (HIGH=1, LOW=0)
-
-