AnalogOutput

class wpilib.AnalogOutput(self: wpilib.AnalogOutput, channel: int) → None

Bases: wpilib.ErrorBase, wpilib.Sendable

MXP analog output class.

Construct an analog output on the given channel.

All analog outputs are located on the MXP port.

Parameters

channel – The channel number on the roboRIO to represent.

getChannel(self: wpilib.AnalogOutput) → int

Get the channel of this AnalogOutput.

getVoltage(self: wpilib.AnalogOutput) → float

Get the voltage of the analog output

Returns

The value in Volts, from 0.0 to +5.0

initSendable(self: wpilib.AnalogOutput, builder: wpilib.SendableBuilder) → None
setVoltage(self: wpilib.AnalogOutput, voltage: float) → None

Set the value of the analog output.

Parameters

voltage – The output value in Volts, from 0.0 to +5.0