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, 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 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-2013 Pi4J. All Rights Reserved.