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:
InputEventListener<AnalogInputEvent>
,java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Runnable
public class Potentiometer extends AnalogInputDevice
Supports taking readings from a potentiometer.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Potentiometer(int gpio)
Potentiometer(AnalogInputDeviceFactoryInterface deviceFactory, int gpio)
-
Method Summary
Modifier and Type Method Description float
getVoltage()
Methods inherited from class com.diozero.api.AnalogInputDevice
addListener, addListener, close, disableDeviceListener, enableDeviceListener, getRange, getScaledValue, getUnscaledValue, run, valueChanged
Methods inherited from class com.diozero.api.GpioInputDevice
addListener, removeAllListeners, removeListener
-
Constructor Details
-
Potentiometer
public Potentiometer(int gpio)- Parameters:
gpio
- GPIO which the potentiometer is connected.
-
Potentiometer
-
-
Method Details
-
getVoltage
public float getVoltage()
-