# Class: TechnicMediumAngularMotor

## TechnicMediumAngularMotor

#### new TechnicMediumAngularMotor()

  Source:
    - devices/technicmediumangularmotor.js, line 25

### Extends

- AbsoluteMotor

### Methods

#### gotoAngle(angle [, speed])

  Rotate a motor by a given angle.

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `angle` | number |  |  | Absolute position the motor should go to (degrees from 0).
  `speed` | number | <optional> | 100 | For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.

  Inherited From:
    - AbsoluteMotor#gotoAngle
  Source:
    - devices/absolutemotor.js, line 52

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### gotoRealZero( [speed])

  Rotate motor to real zero position.

  Real zero is marked on Technic angular motors (SPIKE Prime). It is also available on Technic linear motors (Control+) but is unmarked.

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `speed` | number | <optional> | 100 | Speed between 1 - 100. Note that this will always take the shortest path to zero.

  Inherited From:
    - AbsoluteMotor#gotoRealZero
  Source:
    - devices/absolutemotor.js, line 88

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### resetZero()

  Reset zero to current position

  Inherited From:
    - AbsoluteMotor#resetZero
  Source:
    - devices/absolutemotor.js, line 119

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### rotateByDegrees(degrees [, speed])

  Rotate a motor by a given amount of degrees.

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `degrees` | number |  |  | How much the motor should be rotated (in degrees).
  `speed` | number | <optional> | 100 | For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.

  Inherited From:
    - TachoMotor#rotateByDegrees
  Source:
    - devices/tachomotor.js, line 139

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### setAccelerationTime(time)

  Set the global acceleration time

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `time` | number | How long acceleration should last (in milliseconds).

  Inherited From:
    - TachoMotor#setAccelerationTime
  Source:
    - devices/tachomotor.js, line 73

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### setBrakingStyle(style)

  Set the braking style of the motor.

  Note: This applies to setSpeed, rotateByDegrees, and gotoAngle.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | number | Either BRAKE or HOLD

  Inherited From:
    - TachoMotor#setBrakingStyle
  Source:
    - devices/tachomotor.js, line 53

#### setDecelerationTime(time)

  Set the global deceleration time

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `time` | number | How long deceleration should last (in milliseconds).

  Inherited From:
    - TachoMotor#setDecelerationTime
  Source:
    - devices/tachomotor.js, line 84

  ##### Returns:

  Resolved upon successful completion of command (ie. once the motor is finished).

  Type
    Promise

#### setMaxPower(style)

  Set the max power of the motor.

  Note: This applies to setSpeed, rotateByDegrees, and gotoAngle.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | number | Either BRAKE or HOLD

  Inherited From:
    - TachoMotor#setMaxPower
  Source:
    - devices/tachomotor.js, line 63

#### setSpeed(speed, time)

  Set the motor speed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `speed` | number | For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
  `time` | number | How long the motor should run for (in milliseconds).

  Inherited From:
    - TachoMotor#setSpeed
  Source:
    - devices/tachomotor.js, line 95

  ##### Returns:

  Resolved upon successful issuance of the command.

  Type
    Promise

### Events

#### absolute

  Emits when a the motors absolute position is changed.

  ##### Type: object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `absolute` | number |

  Inherited From:
    - AbsoluteMotor#event:absolute
  Source:
    - devices/absolutemotor.js, line 39

#### rotate

  Emits when a rotation sensor is activated.

  ##### Type: object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `rotation` | number |

  Inherited From:
    - TachoMotor#event:rotate
  Source:
    - devices/tachomotor.js, line 43

#### Search results