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, removeListener
addListener, removeAllListeners, removeListener
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeAllListeners
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
public 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 Button
getState
in class ButtonBase
Copyright © 2012–2016 Pi4J. All rights reserved.