Class: TechnicXLargeLinearMotor

TechnicXLargeLinearMotor


new TechnicXLargeLinearMotor()

Source:

Extends

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

setSpeed(speed)

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.

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

rotate

Emits when a rotation sensor is activated.

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