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
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 Details
-
getValue
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
-
removeListener
void removeListener() -
getMode
-