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, 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
addListener, isOff, isOn, isState, removeListener
removeAllListeners
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
public 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 Switch
getState
in class SwitchBase
Copyright © 2012–2014 Pi4J. All rights reserved.