Package com.diozero.devices
Class Potentiometer
- java.lang.Object
-
- com.diozero.api.GpioDevice
-
- com.diozero.api.GpioInputDevice<AnalogInputEvent>
-
- com.diozero.api.AnalogInputDevice
-
- com.diozero.devices.Potentiometer
-
- All Implemented Interfaces:
DeviceInterface
,DeviceEventConsumer<AnalogInputEvent>
,AutoCloseable
,Runnable
,Consumer<AnalogInputEvent>
public class Potentiometer extends AnalogInputDevice
Supports taking readings from a potentiometer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.diozero.api.AnalogInputDevice
AnalogInputDevice.Builder
-
-
Field Summary
-
Fields inherited from class com.diozero.api.GpioDevice
pinInfo
-
-
Constructor Summary
Constructors Constructor Description Potentiometer(int gpio)
Potentiometer(AnalogInputDeviceFactoryInterface deviceFactory, int gpio)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getVoltage()
-
Methods inherited from class com.diozero.api.AnalogInputDevice
accept, addListener, addListener, close, convertToScaledValue, disableDeviceListener, enableDeviceListener, getRange, getScaledValue, getUnscaledValue, run
-
Methods inherited from class com.diozero.api.GpioInputDevice
addListener, hasListeners, removeAllListeners, removeListener
-
Methods inherited from class com.diozero.api.GpioDevice
getGpio
-
-
-
-
Constructor Detail
-
Potentiometer
public Potentiometer(int gpio)
- Parameters:
gpio
- GPIO which the potentiometer is connected.
-
Potentiometer
public Potentiometer(AnalogInputDeviceFactoryInterface deviceFactory, int gpio)
-
-