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 isGpioPullUpDown.NONE
and an external pull up/down resistor is used.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
Builder
public Builder(int gpio)
-
Builder
public Builder(PinInfo pinInfo)
-
-
Method Detail
-
builder
public static SmoothedInputDevice.Builder builder(int gpio)
-
builder
public static SmoothedInputDevice.Builder builder(PinInfo pinInfo)
-
setPullUpDown
public SmoothedInputDevice.Builder setPullUpDown(GpioPullUpDown pud)
-
setActiveHigh
public SmoothedInputDevice.Builder setActiveHigh(boolean activeHigh)
-
setThreshold
public SmoothedInputDevice.Builder setThreshold(int threshold)
-
setEventAgeMs
public SmoothedInputDevice.Builder setEventAgeMs(int eventAgeMs)
-
setEventDetectPeriodMs
public SmoothedInputDevice.Builder setEventDetectPeriodMs(int eventDetectPeriodMs)
-
setGpioDeviceFactoryInterface
public SmoothedInputDevice.Builder setGpioDeviceFactoryInterface(GpioDeviceFactoryInterface deviceFactory)
-
build
public SmoothedInputDevice build()
-
-