Package edu.wpi.first.wpilibj
Class AnalogOutput
java.lang.Object
edu.wpi.first.wpilibj.AnalogOutput
- All Implemented Interfaces:
Sendable
,AutoCloseable
public class AnalogOutput extends Object implements Sendable, AutoCloseable
Analog output class.
-
Constructor Summary
Constructors Constructor Description AnalogOutput(int channel)
Construct an analog output on a specified MXP channel. -
Method Summary
Modifier and Type Method Description void
close()
int
getChannel()
Get the channel of this AnalogOutput.double
getVoltage()
Get the voltage of the analog output.void
initSendable(SendableBuilder builder)
Initializes thisSendable
object.void
setVoltage(double voltage)
Set the value of the analog output.
-
Constructor Details
-
AnalogOutput
Construct an analog output on a specified MXP channel.- Parameters:
channel
- The channel number to represent.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
getChannel
Get the channel of this AnalogOutput.- Returns:
- The channel of this AnalogOutput.
-
setVoltage
Set the value of the analog output.- Parameters:
voltage
- The output value in Volts, from 0.0 to +5.0.
-
getVoltage
Get the voltage of the analog output.- Returns:
- The value in Volts, from 0.0 to +5.0.
-
initSendable
Description copied from interface:Sendable
Initializes thisSendable
object.- Specified by:
initSendable
in interfaceSendable
- Parameters:
builder
- sendable builder
-