Package com.diozero.internal.spi
Interface AnalogInputDeviceInterface
-
- All Superinterfaces:
AutoCloseable
,DeviceInterface
,InternalDeviceInterface
- All Known Implementing Classes:
PiconZero.PiconZeroAnalogInputDevice
,SysFsAnalogInputDevice
public interface AnalogInputDeviceInterface extends InternalDeviceInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
generatesEvents()
int
getAdcNumber()
default DeviceMode
getMode()
float
getValue()
Read the analog value in the range 0..1 or -1..1 (if the ADC type is signed)void
removeListener()
void
setListener(DeviceEventConsumer<AnalogInputEvent> listener)
-
Methods inherited from interface com.diozero.api.DeviceInterface
close
-
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isOpen
-
-
-
-
Method Detail
-
getValue
float getValue() throws RuntimeIOException
Read the analog value in the range 0..1 or -1..1 (if the ADC type is signed)- Returns:
- the unscaled value (-1..1)
- Throws:
RuntimeIOException
- if an I/O error occurs
-
getAdcNumber
int getAdcNumber()
-
generatesEvents
default boolean generatesEvents()
-
setListener
void setListener(DeviceEventConsumer<AnalogInputEvent> listener)
-
removeListener
void removeListener()
-
getMode
default DeviceMode getMode()
-
-