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:
DeviceEventConsumer<AnalogInputEvent>
,Closeable
,AutoCloseable
,Runnable
,Consumer<AnalogInputEvent>
public class Potentiometer extends AnalogInputDevice
Supports taking readings from a potentiometer.
-
Field Summary
Fields inherited from class com.diozero.api.GpioDevice
gpio
-
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
accept, addListener, addListener, close, convertToScaledValue, disableDeviceListener, enableDeviceListener, getRange, getScaledValue, getUnscaledValue, run
Methods inherited from class com.diozero.api.GpioInputDevice
addListener, removeAllListeners, removeListener
Methods inherited from class com.diozero.api.GpioDevice
getGpio
-
Constructor Details
-
Potentiometer
public Potentiometer(int gpio)- Parameters:
gpio
- GPIO which the potentiometer is connected.
-
Potentiometer
-
-
Method Details
-
getVoltage
public float getVoltage()
-