com.qualcomm.robotcore.hardware

## Interface DcMotorController

- All Superinterfaces:
    HardwareDevice
  All Known Subinterfaces:
    DcMotorControllerEx

      public interface DcMotorController
      extends HardwareDevice

  Interface for working with DC Motor Controllers

  Different DC motor controllers will implement this interface.

- - ### Nested Class Summary

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

      `HardwareDevice.Manufacturer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getMotorCurrentPosition(int motor)` Get the current motor position
    `DcMotor.RunMode` | `getMotorMode(int motor)` Get the current motor mode.
    `double` | `getMotorPower(int motor)` Get the current motor power
    `boolean` | `getMotorPowerFloat(int motor)` Is motor power set to float?
    `int` | `getMotorTargetPosition(int motor)` Get the current motor target position
    `MotorConfigurationType` | `getMotorType(int motor)` Retrieves the motor type configured for this motor
    `DcMotor.ZeroPowerBehavior` | `getMotorZeroPowerBehavior(int motor)` Returns the current zero power behavior of the motor.
    `boolean` | `isBusy(int motor)` Is the motor busy?
    `void` | `resetDeviceConfigurationForOpMode(int motor)` Reset the state we hold for the given motor so that it's clean at the start of an opmode
    `void` | `setMotorMode(int motor, DcMotor.RunMode mode)` Set the current motor mode.
    `void` | `setMotorPower(int motor, double power)` Set the current motor power
    `void` | `setMotorTargetPosition(int motor, int position)` Set the motor target position.
    `void` | `setMotorType(int motor, MotorConfigurationType motorType)` Informs the motor controller of the type of a particular motor.
    `void` | `setMotorZeroPowerBehavior(int motor, DcMotor.ZeroPowerBehavior zeroPowerBehavior)` Sets the behavior of the motor when zero power is applied.

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

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

- - ### Method Detail

    - #### setMotorType

          void setMotorType(int motor,
                            MotorConfigurationType motorType)

      Informs the motor controller of the type of a particular motor. This is normally used only as part of the initialization of a motor.
      Parameters:
        `motor` - port of the motor in question
        `motorType` - the motor type.

    - #### getMotorType

          MotorConfigurationType getMotorType(int motor)

      Retrieves the motor type configured for this motor
      Parameters:
        `motor` - the motor in question
      Returns:
        the configured type for that motor, or `MotorConfigurationType#getUnspecifiedMotorType()` if no type has been configured

    - #### setMotorMode

          void setMotorMode(int motor,
                            DcMotor.RunMode mode)

      Set the current motor mode. `DcMotor.RunMode`
      Parameters:
        `motor` - port of motor
        `mode` - run mode

    - #### getMotorMode

          DcMotor.RunMode getMotorMode(int motor)

      Get the current motor mode. Returns the current "run mode".
      Parameters:
        `motor` - port of motor
      Returns:
        run mode

    - #### setMotorPower

          void setMotorPower(int motor,
                             double power)

      Set the current motor power
      Parameters:
        `motor` - port of motor
        `power` - from -1.0 to 1.0

    - #### getMotorPower

          double getMotorPower(int motor)

      Get the current motor power
      Parameters:
        `motor` - port of motor
      Returns:
        scaled from -1.0 to 1.0

    - #### isBusy

          boolean isBusy(int motor)

      Is the motor busy?
      Parameters:
        `motor` - port of motor
      Returns:
        true if the motor is busy

    - #### setMotorZeroPowerBehavior

          void setMotorZeroPowerBehavior(int motor,
                                         DcMotor.ZeroPowerBehavior zeroPowerBehavior)

      Sets the behavior of the motor when zero power is applied.
      Parameters:
        `zeroPowerBehavior` - the behavior of the motor when zero power is applied.

    - #### getMotorZeroPowerBehavior

          DcMotor.ZeroPowerBehavior getMotorZeroPowerBehavior(int motor)

      Returns the current zero power behavior of the motor.
      Returns:
        the current zero power behavior of the motor.

    - #### getMotorPowerFloat

          boolean getMotorPowerFloat(int motor)

      Is motor power set to float?
      Parameters:
        `motor` - port of motor
      Returns:
        true of motor is set to float

    - #### setMotorTargetPosition

          void setMotorTargetPosition(int motor,
                                      int position)

      Set the motor target position. This takes in an integer, which is not scaled. Motor power should be positive if using run to position
      Parameters:
        `motor` - port of motor
        `position` - range from Integer.MIN_VALUE to Integer.MAX_VALUE

    - #### getMotorTargetPosition

          int getMotorTargetPosition(int motor)

      Get the current motor target position
      Parameters:
        `motor` - port of motor
      Returns:
        integer, unscaled

    - #### getMotorCurrentPosition

          int getMotorCurrentPosition(int motor)

      Get the current motor position
      Parameters:
        `motor` - port of motor
      Returns:
        integer, unscaled

    - #### resetDeviceConfigurationForOpMode

          void resetDeviceConfigurationForOpMode(int motor)

      Reset the state we hold for the given motor so that it's clean at the start of an opmode
      Parameters:
        `motor` -