Package com.diozero.api
Class AnalogOutputDevice
- java.lang.Object
-
- com.diozero.api.GpioDevice
-
- com.diozero.api.AnalogOutputDevice
-
- All Implemented Interfaces:
DeviceInterface
,OutputDeviceInterface
,AutoCloseable
public class AnalogOutputDevice extends GpioDevice implements OutputDeviceInterface
Analog output device. The output value is scaled in the range 0..1.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnalogOutputDevice.Builder
-
Field Summary
-
Fields inherited from class com.diozero.api.GpioDevice
pinInfo
-
-
Constructor Summary
Constructors Constructor Description AnalogOutputDevice(AnalogOutputDeviceFactoryInterface deviceFactory, PinInfo pinInfo, float initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this devicefloat
getValue()
void
setValue(float value)
Set the analog output value-
Methods inherited from class com.diozero.api.GpioDevice
getGpio
-
-
-
-
Constructor Detail
-
AnalogOutputDevice
public AnalogOutputDevice(AnalogOutputDeviceFactoryInterface deviceFactory, PinInfo pinInfo, float initialValue)
-
-
Method Detail
-
getValue
public float getValue()
-
setValue
public void setValue(float value) throws IllegalArgumentException
Set the analog output value- Specified by:
setValue
in interfaceOutputDeviceInterface
- Parameters:
value
- new analog output value in the range 0..1- Throws:
IllegalArgumentException
- if value is out of bounds
-
close
public void close()
Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
-
-