com.qualcomm.robotcore.hardware

## Interface DcMotorControllerEx

- All Superinterfaces:
    DcMotorController, HardwareDevice

      public interface DcMotorControllerEx
      extends DcMotorController

  DcMotorControllerEx is an optional motor controller interface supported by some hardware that provides enhanced motor functionality.
  See Also:
    `DcMotorEx`

- - ### Nested Class Summary

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

      `HardwareDevice.Manufacturer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getMotorVelocity(int motor)` Returns the velocity of the indicated motor in ticks per second.
    `double` | `getMotorVelocity(int motor, AngleUnit unit)` Returns the velocity of the indicated motor.
    `PIDCoefficients` | `getPIDCoefficients(int motor, DcMotor.RunMode mode)` Deprecated. Use `getPIDFCoefficients(int, DcMotor.RunMode)` instead
    `PIDFCoefficients` | `getPIDFCoefficients(int motor, DcMotor.RunMode mode)` Returns the coefficients used for PIDF control on the indicated motor when in the indicated mode
    `boolean` | `isMotorEnabled(int motor)` Returns whether a particular motor on the controller is energized
    `void` | `setMotorDisable(int motor)` Individually denergizes a particular motor
    `void` | `setMotorEnable(int motor)` Individually energizes a particular motor
    `void` | `setMotorTargetPosition(int motor, int position, int tolerance)` Sets the target position and tolerance for a 'run to position' operation.
    `void` | `setMotorVelocity(int motor, double ticksPerSecond)` Sets the target velocity of the indicated motor.
    `void` | `setMotorVelocity(int motor, double angularRate, AngleUnit unit)` Sets the target velocity of the indicated motor.
    `void` | `setPIDCoefficients(int motor, DcMotor.RunMode mode, PIDCoefficients pidCoefficients)` Deprecated. Use `setPIDFCoefficients(int, DcMotor.RunMode, PIDFCoefficients)` instead
    `void` | `setPIDFCoefficients(int motor, DcMotor.RunMode mode, PIDFCoefficients pidfCoefficients)` Sets the coefficients used for PIDF control on the indicated motor when in the indicated mode

    - ### Methods inherited from interface com.qualcomm.robotcore.hardware.DcMotorController

      `getMotorCurrentPosition, getMotorMode, getMotorPower, getMotorPowerFloat, getMotorTargetPosition, getMotorType, getMotorZeroPowerBehavior, isBusy, resetDeviceConfigurationForOpMode, setMotorMode, setMotorPower, setMotorTargetPosition, setMotorType, setMotorZeroPowerBehavior`

    - ### Methods inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `close, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpMode`

- - ### Method Detail

    - #### setMotorEnable

          void setMotorEnable(int motor)

      Individually energizes a particular motor
      Parameters:
        `motor` - the port number of the motor on this controller
      See Also:
        `setMotorDisable(int)`, `isMotorEnabled(int)`

    - #### setMotorDisable

          void setMotorDisable(int motor)

      Individually denergizes a particular motor
      Parameters:
        `motor` - the port number of the motor on this controller
      See Also:
        `setMotorEnable(int)`, `isMotorEnabled(int)`

    - #### isMotorEnabled

          boolean isMotorEnabled(int motor)

      Returns whether a particular motor on the controller is energized
      Parameters:
        `motor` - the port number of the motor on this controller
      See Also:
        `setMotorEnable(int)`, `setMotorDisable(int)`

    - #### setMotorVelocity

          void setMotorVelocity(int motor,
                                double ticksPerSecond)

      Sets the target velocity of the indicated motor.
      Parameters:
        `motor` - the port number of the motor on this controller
        `ticksPerSecond` - the new target rate for that motor, in ticks per second

    - #### setMotorVelocity

          void setMotorVelocity(int motor,
                                double angularRate,
                                AngleUnit unit)

      Sets the target velocity of the indicated motor.
      Parameters:
        `motor` - motor whose velocity is to be adjusted
        `angularRate` - the new target rate for that motor, in 'unit's per second
        `unit` - the unit inw which angularRate is expressed.
      See Also:
        `DcMotorEx.setVelocity(double, AngleUnit)`

    - #### getMotorVelocity

          double getMotorVelocity(int motor)

      Returns the velocity of the indicated motor in ticks per second.
      Parameters:
        `motor` - the motor whose velocity is desired
      Returns:
        the current target velocity of the motor in ticks per second

    - #### getMotorVelocity

          double getMotorVelocity(int motor,
                                  AngleUnit unit)

      Returns the velocity of the indicated motor.
      Parameters:
        `motor` - the motor whose velocity is desired
        `unit` - the angular unit in which the velocity is to be expressed
      Returns:
        the current velocity of the motor
      See Also:
        `DcMotorEx.getVelocity(AngleUnit)`

    - #### setPIDCoefficients

          @Deprecated
          void setPIDCoefficients(int motor,
                                              DcMotor.RunMode mode,
                                              PIDCoefficients pidCoefficients)

      Deprecated. Use `setPIDFCoefficients(int, DcMotor.RunMode, PIDFCoefficients)` instead
      Sets the coefficients used for PID control on the indicated motor when in the indicated mode
      Parameters:
        `motor` - the motor whose PID coefficients are to be set
        `mode` - the mode on that motor whose coefficients are to be set
        `pidCoefficients` - the new coefficients to set
      See Also:
        `DcMotorEx.setPIDCoefficients(DcMotor.RunMode, PIDCoefficients)`, `getPIDCoefficients(int, DcMotor.RunMode)`

    - #### setPIDFCoefficients

          void setPIDFCoefficients(int motor,
                                   DcMotor.RunMode mode,
                                   PIDFCoefficients pidfCoefficients)
                            throws java.lang.UnsupportedOperationException

      Sets the coefficients used for PIDF control on the indicated motor when in the indicated mode
      Parameters:
        `motor` - the motor whose PIDF coefficients are to be set
        `mode` - the mode on that motor whose coefficients are to be set
        `pidfCoefficients` - the new coefficients to set
      Throws:
        `java.lang.UnsupportedOperationException`
      See Also:
        `DcMotorEx.setPIDFCoefficients(DcMotor.RunMode, PIDFCoefficients)`, `getPIDFCoefficients(int, DcMotor.RunMode)`

    - #### getPIDCoefficients

          @Deprecated
          PIDCoefficients getPIDCoefficients(int motor,
                                                         DcMotor.RunMode mode)

      Deprecated. Use `getPIDFCoefficients(int, DcMotor.RunMode)` instead
      Returns the coefficients used for PID control on the indicated motor when in the indicated mode
      Parameters:
        `motor` - the motor whose PID coefficients are desired
        `mode` - the mode on that motor whose coefficients are to be queried
      Returns:
        the coefficients used for PID control on the indicated motor when in the indicated mode
      See Also:
        `DcMotorEx.getPIDCoefficients(DcMotor.RunMode)`, `setPIDCoefficients(int, DcMotor.RunMode, PIDCoefficients)`

    - #### getPIDFCoefficients

          PIDFCoefficients getPIDFCoefficients(int motor,
                                               DcMotor.RunMode mode)

      Returns the coefficients used for PIDF control on the indicated motor when in the indicated mode
      Parameters:
        `motor` - the motor whose PIDF coefficients are desired
        `mode` - the mode on that motor whose coefficients are to be queried
      Returns:
        the coefficients used for PIDF control on the indicated motor when in the indicated mode
      See Also:
        `DcMotorEx.getPIDCoefficients(DcMotor.RunMode)`, `setPIDFCoefficients(int, DcMotor.RunMode, PIDFCoefficients)`

    - #### setMotorTargetPosition

          void setMotorTargetPosition(int motor,
                                      int position,
                                      int tolerance)

      Sets the target position and tolerance for a 'run to position' operation.
      Parameters:
        `motor` - the motor number to be affected
        `position` - the desired target position, in encoder ticks
        `tolerance` - the tolerance of the desired target position, in encoder ticks