public class GpioSensorComponent extends SensorBase
listeners| Constructor and Description |
|---|
GpioSensorComponent(GpioPinDigitalInput pin)
default constructor; using this constructor assumes that:
(1) a pin state of HIGH is SENSOR CLOSED
(2) a pin state of LOW is SENSOR OPEN
|
GpioSensorComponent(GpioPinDigitalInput pin,
PinState openState,
PinState closedState)
using this constructor requires that the consumer
define the SENSOR OPEN and SENSOR CLOSED pin states
|
| Modifier and Type | Method and Description |
|---|---|
SensorState |
getState()
Return the current sensor state based on the
GPIO digital output pin state.
|
addListener, isClosed, isOpen, isState, 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 GpioSensorComponent(GpioPinDigitalInput pin, PinState openState, PinState closedState)
pin - GPIO digital input pinopenState - pin state to set when SENSOR is OPENclosedState - pin state to set when SENSOR is CLOSEDpublic GpioSensorComponent(GpioPinDigitalInput pin)
pin - GPIO digital input pinpublic SensorState getState()
getState in interface SensorgetState in class SensorBaseCopyright © 2012-2013 Pi4J. All Rights Reserved.