public class GpioLightComponent extends LightBase
listeners
Constructor and Description |
---|
GpioLightComponent(GpioPinDigitalOutput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is LIGHT ON
(2) a pin state of LOW is LIGHT OFF
|
GpioLightComponent(GpioPinDigitalOutput pin,
PinState onState,
PinState offState)
using this constructor requires that the consumer
define the LIGHT ON and LIGHT OFF pin states
|
Modifier and Type | Method and Description |
---|---|
boolean |
isOn()
Return the current power state based on the
GPIO digital output pin state.
|
void |
off()
Set the current GPIO digital output pin state
based for LIGHT OFF
|
void |
on()
Set the current GPIO digital output pin state
based for LIGHT ON
|
addListener, isOff, 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
removeAllListeners
clearProperties, getName, getProperties, getProperty, getProperty, getTag, hasProperty, removeProperty, setName, setProperty, setTag
public GpioLightComponent(GpioPinDigitalOutput pin, PinState onState, PinState offState)
pin
- GPIO digital output pinonState
- pin state to set when power is ONoffState
- pin state to set when power is OFFpublic GpioLightComponent(GpioPinDigitalOutput pin)
pin
- GPIO digital output pinCopyright © 2012–2014 Pi4J. All rights reserved.