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 Details

    • AnalogOutput

      public AnalogOutput(int channel)
      Construct an analog output on a specified MXP channel.
      Parameters:
      channel - The channel number to represent.
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getChannel

      public int getChannel()
      Get the channel of this AnalogOutput.
      Returns:
      The channel of this AnalogOutput.
    • setVoltage

      public void setVoltage(double voltage)
      Set the value of the analog output.
      Parameters:
      voltage - The output value in Volts, from 0.0 to +5.0.
    • getVoltage

      public double getVoltage()
      Get the voltage of the analog output.
      Returns:
      The value in Volts, from 0.0 to +5.0.
    • initSendable

      public void initSendable(SendableBuilder builder)
      Description copied from interface: Sendable
      Initializes this Sendable object.
      Specified by:
      initSendable in interface Sendable
      Parameters:
      builder - sendable builder