com.qualcomm.robotcore.hardware

## Interface DcMotorSimple

- All Superinterfaces:
    HardwareDevice
  All Known Subinterfaces:
    CRServo, DcMotor, DcMotorEx
  All Known Implementing Classes:
    CRServoImpl, CRServoImplEx, DcMotorImpl, DcMotorImplEx

      public interface DcMotorSimple
      extends HardwareDevice

  Instances of DcMotorSimple interface provide a most basic motor-like functionality

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `DcMotorSimple.Direction` DcMotors can be configured to internally reverse the values to which, e.g., their motor power is set.

    - ### 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
    --- | ---
    `DcMotorSimple.Direction` | `getDirection()` Returns the current logical direction in which this motor is set as operating.
    `double` | `getPower()` Returns the current configured power level of the motor.
    `void` | `setDirection(DcMotorSimple.Direction direction)` Sets the logical direction in which this motor operates.
    `void` | `setPower(double power)` Sets the power level of the motor, expressed as a fraction of the maximum possible power / speed supported according to the run mode in which the motor is operating.

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

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

- - ### Method Detail

    - #### setDirection

          void setDirection(DcMotorSimple.Direction direction)

      Sets the logical direction in which this motor operates.
      Parameters:
        `direction` - the direction to set for this motor
      See Also:
        `getDirection()`

    - #### getDirection

          DcMotorSimple.Direction getDirection()

      Returns the current logical direction in which this motor is set as operating.
      Returns:
        the current logical direction in which this motor is set as operating.
      See Also:
        `setDirection(Direction)`

    - #### setPower

          void setPower(double power)

      Sets the power level of the motor, expressed as a fraction of the maximum possible power / speed supported according to the run mode in which the motor is operating.

      Setting a power level of zero will brake the motor

      Parameters:
        `power` - the new power level of the motor, a value in the interval [-1.0, 1.0]
      See Also:
        `getPower()`, `DcMotor.setMode(DcMotor.RunMode)`, `DcMotor.setPowerFloat()`

    - #### getPower

          double getPower()

      Returns the current configured power level of the motor.
      Returns:
        the current level of the motor, a value in the interval [0.0, 1.0]
      See Also:
        `setPower(double)`