Uses of Interface
com.diozero.api.function.DeviceEventConsumer
-
Packages that use DeviceEventConsumer Package Description com.diozero.api Core APIs for interfacing with devices.com.diozero.devices Classes representing actual devices such as LEDs, Buttons as well as GPIO, devices that are connected via I2C, SPI and Serial interfaces.com.diozero.devices.mcp23xxx com.diozero.devices.sandpit com.diozero.internal.spi Service Provider Interface package. -
-
Uses of DeviceEventConsumer in com.diozero.api
Classes in com.diozero.api that implement DeviceEventConsumer Modifier and Type Class Description class
AbstractDigitalInputDevice
Abstract base class for low-level GPIO digital input devices.class
AnalogInputDevice
The AnalogInputDevice base class encapsulates logic for interfacing with analog devices.class
DebouncedDigitalInputDevice
Digital input device with debounce logic.class
DigitalInputDevice
Represents a generic digital input device.class
DigitalInputOutputDevice
class
GpioInputDevice<T extends DeviceEvent>
Common base class for digital and analog input devices.class
SmoothedInputDevice
Represents a generic input device which takes its value from the number of active events over a specific time period.Methods in com.diozero.api with parameters of type DeviceEventConsumer Modifier and Type Method Description void
AnalogInputDevice. addListener(DeviceEventConsumer<AnalogInputEvent> listener, float percentChange)
Register a listener for value changes, will check for changes every 50ms.void
AnalogInputDevice. addListener(DeviceEventConsumer<AnalogInputEvent> listener, float percentChange, int pollInterval)
Register a listener for value changes, will check for changes every 50ms.void
GpioInputDevice. addListener(DeviceEventConsumer<T> listener)
Add a new listenervoid
GpioInputDevice. removeListener(DeviceEventConsumer<T> listener)
Remove a specific listener -
Uses of DeviceEventConsumer in com.diozero.devices
Classes in com.diozero.devices that implement DeviceEventConsumer Modifier and Type Class Description class
Button
Provides push button related utility methods.class
GP2Y0A21YK
Sharp GP2Y0A21YK distance sensor.class
LDR
Generic Photoresistor / Light-Dependent-Resistor (LDR).
Wiring:class
LedButton
A button with an embedded LED.class
MCP23008
class
MCP23017
class
MCP23S17
class
Potentiometer
Supports taking readings from a potentiometer.class
TMP36
Support for reading temperature values from a TMP36 Temperature Sensor by Analog DevicesMethods in com.diozero.devices with parameters of type DeviceEventConsumer Modifier and Type Method Description void
PiconZero.PiconZeroDigitalInputDevice. setListener(DeviceEventConsumer<DigitalInputEvent> listener)
-
Uses of DeviceEventConsumer in com.diozero.devices.mcp23xxx
Classes in com.diozero.devices.mcp23xxx that implement DeviceEventConsumer Modifier and Type Class Description class
MCP23x08
class
MCP23x17
class
MCP23xxx
Support for both MCP23008 and MCP23017 GPIO expansion boards. -
Uses of DeviceEventConsumer in com.diozero.devices.sandpit
Classes in com.diozero.devices.sandpit that implement DeviceEventConsumer Modifier and Type Class Description class
HCSR04UsingEvents
Note this version doesn't work as well as the polling-based HCSR04 version.class
MotionSensor
A Passive Infra-Red (PIR) motion sensor.class
TCS3200
This class reads RGB values from a TCS3200 colour sensor. -
Uses of DeviceEventConsumer in com.diozero.internal.spi
Methods in com.diozero.internal.spi with parameters of type DeviceEventConsumer Modifier and Type Method Description void
AbstractInputDevice. setListener(DeviceEventConsumer<T> listener)
void
AnalogInputDeviceInterface. setListener(DeviceEventConsumer<AnalogInputEvent> listener)
void
GpioDigitalInputDeviceInterface. setListener(DeviceEventConsumer<DigitalInputEvent> listener)
void
GpioDigitalInputOutputDeviceInterface. setListener(DeviceEventConsumer<DigitalInputEvent> listener)
-