[][src]Module ev3dev_lang_rust::tacho_motor

Structs

LargeMotor
MediumMotor

Constants

POLARITY

A positive duty cycle will cause the motor to rotate counter-clockwise.

POLARITY_NORMAL

A positive duty cycle will cause the motor to rotate clockwise.

RESET

Resets all of the motor parameter attributes to their default values. This will also have the effect of stopping the motor.

RUN_DIRECT

Runs the motor using the duty cycle specified by duty_cycle_sp. Unlike other run commands, changing duty_cycle_sp while running will take effect immediately.

RUN_FOREVER

Causes the motor to run until another command is sent.

RUN_TIMED

Run the motor for the amount of time specified in time_sp and then stops the motor using the command specified by stop_action.

RUN_TO_ABS_POS

Runs the motor to an absolute position specified by position_sp and then stops the motor using the command specified in stop_action.

RUN_TO_REL_POS

Runs the motor to a position relative to the current position value. The new position will be current position + position_sp. When the new position is reached, the motor will stop using the command specified by stop_action.

STATE_HOLDING

The motor is not turning, but rather attempting to hold a fixed position.

STATE_OVERLOADED

The motor is turning as fast as possible, but cannot reach its speed_sp.

STATE_RAMPING

The motor is ramping up or down and has not yet reached a constant output level.

STATE_RUNNING

Power is being sent to the motor.

STATE_STALLED

The motor is trying to run but is not turning at all.

STOP

Stop any of the run commands before they are complete using the command specified by stop_action.

STOP_ACTION_BRAKE

Removes power from the motor and creates a passive electrical load. This is usually done by shorting the motor terminals together. This load will absorb the energy from the rotation of the motors and cause the motor to stop more quickly than coasting.

STOP_ACTION_COAST

Removes power from the motor. The motor will freely coast to a stop.

STOP_ACTION_HOLD

Causes the motor to actively try to hold the current position. If an external force tries to turn the motor, the motor will “push back” to maintain its position.

Traits

TachoMotor

The tacho-motor class provides a uniform interface for using motors with positional and directional feedback such as the EV3 and NXT motors. This feedback allows for precise control of the motors.