public class GpioRelayComponent extends RelayBase
DEFAULT_PULSE_MILLISECONDSlisteners| Constructor and Description |
|---|
GpioRelayComponent(GpioPinDigitalOutput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is RELAY CLOSED
(2) a pin state of LOW is RELAY OPEN
|
GpioRelayComponent(GpioPinDigitalOutput pin,
PinState openState,
PinState closedState)
using this constructor requires that the consumer
define the RELAY OPEN and RELAY closed pin states
|
| Modifier and Type | Method and Description |
|---|---|
RelayState |
getState()
Return the current relay state based on the
GPIO digital output pin state.
|
void |
pulse(int milliseconds) |
void |
setState(RelayState state)
Set the current GPIO digital output pin state
based on the supplied power state
|
addListener, close, isClosed, isOpen, isState, notifyListeners, open, pulse, removeListener, toggleaddListener, 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 GpioRelayComponent(GpioPinDigitalOutput pin, PinState openState, PinState closedState)
pin - GPIO digital output pinopenState - pin state to set when relay is OPENclosedState - pin state to set when relay is CLOSEDpublic GpioRelayComponent(GpioPinDigitalOutput pin)
pin - GPIO digital output pinpublic RelayState getState()
public void setState(RelayState state)
Copyright © 2012-2013 Pi4J. All Rights Reserved.