Package com.diozero.api
Class SmoothedInputDevice.Builder
java.lang.Object
com.diozero.api.SmoothedInputDevice.Builder
- Enclosing class:
- SmoothedInputDevice
public static class SmoothedInputDevice.Builder extends Object
Smoothed input device builder. Default values:
- pud:
GpioPullUpDown.NONE
- activeHigh:
- set to false if pud ==
GpioPullUpDown.PULL_UP
, otherwise true (assumes normally open wiring configuration) - deviceFactory:
DeviceFactoryHelper.getNativeDeviceFactory()
- threshold:
- 1
- eventAge:
- 20
- eventDetectPeriodMs:
- 10
PinInfo
instance must be specified. Using a
PinInfo instance allows input devices to be identified by either physical pin
number or GPIO chip and line offset.
The optional activeHigh parameter defaults assume a normally open wiring
configuration, however, it can be overridden for normally closed
configurations as well as scenarios where pud is GpioPullUpDown.NONE
and an external pull up/down resistor is used.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description SmoothedInputDevice
build()
static SmoothedInputDevice.Builder
builder(int gpio)
static SmoothedInputDevice.Builder
builder(PinInfo pinInfo)
SmoothedInputDevice.Builder
setActiveHigh(boolean activeHigh)
SmoothedInputDevice.Builder
setEventAgeMs(int eventAgeMs)
SmoothedInputDevice.Builder
setEventDetectPeriodMs(int eventDetectPeriodMs)
SmoothedInputDevice.Builder
setGpioDeviceFactoryInterface(GpioDeviceFactoryInterface deviceFactory)
SmoothedInputDevice.Builder
setPullUpDown(GpioPullUpDown pud)
SmoothedInputDevice.Builder
setThreshold(int threshold)
-
Constructor Details
-
Builder
public Builder(int gpio) -
Builder
-
-
Method Details
-
builder
-
builder
-
setPullUpDown
-
setActiveHigh
-
setThreshold
-
setEventAgeMs
-
setEventDetectPeriodMs
-
setGpioDeviceFactoryInterface
public SmoothedInputDevice.Builder setGpioDeviceFactoryInterface(GpioDeviceFactoryInterface deviceFactory) -
build
-