public class GpioPowerComponent extends PowerBase
listeners
Constructor and Description |
---|
GpioPowerComponent(GpioPinDigitalOutput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is POWER ON
(2) a pin state of LOW is POWER OFF
|
GpioPowerComponent(GpioPinDigitalOutput pin,
PinState onState,
PinState offState)
using this constructor requires that the consumer
define the POWER ON and POWER OFF pin states
|
Modifier and Type | Method and Description |
---|---|
PowerState |
getState()
Return the current power state based on the
GPIO digital output pin state.
|
void |
setState(PowerState state)
Set the current GPIO digital output pin state
based on the supplied power state
|
addListener, isOff, isOn, notifyListeners, off, on, 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 GpioPowerComponent(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 GpioPowerComponent(GpioPinDigitalOutput pin)
pin
- GPIO digital output pinpublic PowerState getState()
public void setState(PowerState state)
Copyright © 2012–2014 Pi4J. All rights reserved.