Package com.diozero.internal.spi
Interface AnalogInputDeviceInterface
- All Superinterfaces:
AutoCloseable
,Closeable
,DeviceInterface
- All Known Implementing Classes:
PiconZero.PiconZeroAnalogInputDevice
,SysFsAnalogInputDevice
public interface AnalogInputDeviceInterface extends DeviceInterface
-
Method Summary
Modifier and Type Method Description void
close()
Close this devicedefault 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
getKey, isOpen
-
Method Details
-
close
void close()Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceDeviceInterface
-
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
-