MediumLinearMotor

MediumLinearMotor

new MediumLinearMotor()

Source:

Extends

Methods

rotateByDegrees(degrees, speedopt) → {Promise}

Rotate a motor by a given amount of degrees.

Parameters:
Name Type Attributes 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:
Source:

setAccelerationTime(time) → {Promise}

Set the global acceleration time

Parameters:
Name Type Description
time number

How long acceleration should last (in milliseconds).

Inherited From:
Source:

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:
Source:

setDecelerationTime(time) → {Promise}

Set the global deceleration time

Parameters:
Name Type Description
time number

How long deceleration should last (in milliseconds).

Inherited From:
Source:

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:
Source:

setSpeed(speed, time) → {Promise}

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:
Source:

Events

rotate :object

Emits when a rotation sensor is activated.

Parameters:
Name Type Description
rotation number
Inherited From:
Source: