com.qualcomm.robotcore.hardware

## Class AnalogOutput

- java.lang.Object
- - com.qualcomm.robotcore.hardware.AnalogOutput

- All Implemented Interfaces:
    HardwareDevice

      public class AnalogOutput
      extends java.lang.Object
      implements HardwareDevice

  Control a single analog device

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `HardwareDevice.Manufacturer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnalogOutput(AnalogOutputController controller, int channel)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this device
    `java.lang.String` | `getConnectionInfo()` Get connection information about this device in a human readable format
    `java.lang.String` | `getDeviceName()` Returns a string suitable for display to the user as to the type of device.
    `HardwareDevice.Manufacturer` | `getManufacturer()` Returns an indication of the manufacturer of this device.
    `int` | `getVersion()` Version
    `void` | `resetDeviceConfigurationForOpMode()` Resets the device's configuration to that which is expected at the beginning of an OpMode.
    `void` | `setAnalogOutputFrequency(int freq)` Sets the channel output frequency in the range 1-5,000 Hz in mode 1, 2 or 3.
    `void` | `setAnalogOutputMode(byte mode)` Sets the channel operating mode.
    `void` | `setAnalogOutputVoltage(int voltage)` Sets the channel output voltage.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AnalogOutput

          public AnalogOutput(AnalogOutputController controller,
                              int channel)

      Constructor
      Parameters:
        `controller` - AnalogOutput controller this channel is attached to
        `channel` - channel on the analog output controller

  - ### Method Detail

    - #### setAnalogOutputVoltage

          public void setAnalogOutputVoltage(int voltage)

      Sets the channel output voltage. If mode == 0: takes input from -1023-1023, output in the range -4 to +4 volts. If mode == 1, 2, or 3: takes input from 0-1023, output in the range 0 to 8 volts.
      Parameters:
        `voltage` - voltage value in the correct range.

    - #### setAnalogOutputFrequency

          public void setAnalogOutputFrequency(int freq)

      Sets the channel output frequency in the range 1-5,000 Hz in mode 1, 2 or 3. If mode 0 is selected, this field will be over-written to 0.
      Parameters:
        `freq` - output frequency in the range1-5,000Hz

    - #### setAnalogOutputMode

          public void setAnalogOutputMode(byte mode)

      Sets the channel operating mode. Mode 0: Voltage output. Range: -4V - 4V Mode 1: Sine wave output. Range: 0 - 8V Mode 2: Square wave output. Range: 0 - 8V Mode 3: Triangle wave output. Range: 0 - 8V
      Parameters:
        `mode` - voltage, sine, square, or triangle

    - #### getManufacturer

          public HardwareDevice.Manufacturer getManufacturer()

      Description copied from interface: `HardwareDevice`
      Returns an indication of the manufacturer of this device.
      Specified by:
        `getManufacturer` in interface `HardwareDevice`
      Returns:
        the device's manufacturer

    - #### getDeviceName

          public java.lang.String getDeviceName()

      Description copied from interface: `HardwareDevice`
      Returns a string suitable for display to the user as to the type of device. Note that this is a device-type-specific name; it has nothing to do with the name by which a user might have configured the device in a robot configuration.
      Specified by:
        `getDeviceName` in interface `HardwareDevice`
      Returns:
        device manufacturer and name

    - #### getConnectionInfo

          public java.lang.String getConnectionInfo()

      Description copied from interface: `HardwareDevice`
      Get connection information about this device in a human readable format
      Specified by:
        `getConnectionInfo` in interface `HardwareDevice`
      Returns:
        connection info

    - #### getVersion

          public int getVersion()

      Description copied from interface: `HardwareDevice`
      Version
      Specified by:
        `getVersion` in interface `HardwareDevice`
      Returns:
        get the version of this device

    - #### resetDeviceConfigurationForOpMode

          public void resetDeviceConfigurationForOpMode()

      Description copied from interface: `HardwareDevice`
      Resets the device's configuration to that which is expected at the beginning of an OpMode. For example, motors will reset the their direction to 'forward'.
      Specified by:
        `resetDeviceConfigurationForOpMode` in interface `HardwareDevice`

    - #### close

          public void close()

      Description copied from interface: `HardwareDevice`
      Closes this device
      Specified by:
        `close` in interface `HardwareDevice`