public class GpioButtonComponent extends ButtonBase
listeners| Constructor and Description |
|---|
GpioButtonComponent(GpioPinDigitalInput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is BUTTON PRESSED
(2) a pin state of LOW is BUTTON RELEASED
|
GpioButtonComponent(GpioPinDigitalInput pin,
PinState releasedState,
PinState pressedState)
using this constructor requires that the consumer
define the BUTTON PRESSED/RELEASED pin states
|
| Modifier and Type | Method and Description |
|---|---|
ButtonState |
getState()
Return the current switch state based on the
GPIO digital output pin state.
|
addListener, addListener, addListener, addListener, isPressed, isReleased, isState, notifyListeners, removeListener, removeListener, removeListener, removeListeneraddListener, removeAllListeners, removeListenerclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveAllListenersclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagpublic GpioButtonComponent(GpioPinDigitalInput pin, PinState releasedState, PinState pressedState)
pin - GPIO digital input pinreleasedState - pin state to set when BUTTON is RELEASEDpressedState - pin state to set when BUTTON is PRESSEDpublic GpioButtonComponent(GpioPinDigitalInput pin)
pin - GPIO digital input pinpublic ButtonState getState()
getState in interface ButtongetState in class ButtonBaseCopyright © 2012–2019 Pi4J. All rights reserved.