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, 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 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 Sensor
getState
in class SensorBase
Copyright © 2012–2014 Pi4J. All rights reserved.