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
Methods inherited from class com.diozero.api.GpioDevice
getGpio
-
Constructor Details
-
AnalogOutputDevice
public AnalogOutputDevice(AnalogOutputDeviceFactoryInterface deviceFactory, PinInfo pinInfo, float initialValue)
-
-
Method Details
-
getValue
public float getValue() -
setValue
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
-