Package edu.wpi.first.wpilibj
Class AnalogOutput
java.lang.Object
edu.wpi.first.wpilibj.AnalogOutput
- All Implemented Interfaces:
Sendable,AutoCloseable
Analog output class.
-
Constructor Summary
ConstructorsConstructorDescriptionAnalogOutput(int channel) Construct an analog output on a specified MXP channel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intGet the channel of this AnalogOutput.doubleGet the voltage of the analog output.voidinitSendable(SendableBuilder builder) Initializes thisSendableobject.voidsetVoltage(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:
closein 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:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-