public class GpioToggleSwitchComponent extends ToggleSwitchBase
listeners| Constructor and Description |
|---|
GpioToggleSwitchComponent(GpioPinDigitalInput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is SWITCH CLOSED/ON
(2) a pin state of LOW is SWITCH OPEN/OFF
|
GpioToggleSwitchComponent(GpioPinDigitalInput pin,
PinState offState,
PinState onState)
using this constructor requires that the consumer
define the SWITCH OPEN/OFF and SWITCH CLOSED/ON pin states
|
| Modifier and Type | Method and Description |
|---|---|
SwitchState |
getState()
Return the current switch state based on the
GPIO digital output pin state.
|
addListener, isOff, isOn, isState, notifyListeners, removeListeneraddListener, removeAllListeners, removeListenerclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, isOff, isOn, isState, removeListenerremoveAllListenersclearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTagpublic GpioToggleSwitchComponent(GpioPinDigitalInput pin, PinState offState, PinState onState)
pin - GPIO digital input pinoffState - pin state to set when SWITCH is OPEN/OFFonState - pin state to set when SWITCH is CLOSED/ONpublic GpioToggleSwitchComponent(GpioPinDigitalInput pin)
pin - GPIO digital input pinpublic SwitchState getState()
getState in interface SwitchgetState in class SwitchBaseCopyright © 2012-2013 Pi4J. All Rights Reserved.