Stop

Stops or brakes specified motor(s)

Contents

Syntax

OBJ.Stop()

OBJ.Stop(BRAKEMODE)

OBJ.Stop(BRAKEMODE, HANDLE)

Description

OBJ.Stop() is the same as OBJ.Stop('off').

OBJ.Stop(BRAKEMODE) stops the motor specified in OBJ with the brakemode specified in BRAKEMODE:

BRAKEMODE can take the following values:

'nobrake', 'off', 0, false: The electrical power to the specified motor is simply disconnected, the so-called "COAST" mode. Motor will keep spinning until it comes to a soft stop.

'brake', 'on', 1, true: This will actively halt the motor at the current position (until the next movement command); it's a "hard brake".

Use HANDLE to identify the connection to use for this command (optional).

Note:

To stop all motors at precisely the same time, please see the command StopMotor. It can be called with the syntax StopMotor('all', 'off') or StopMotor('all', 'brake'). When comparing this to the obj.Stop method, it acts more precise when wanting to stop multiple motors at the same time...

Using the active brake (e.g. .Stop('brake')) can be very power consuming, so watch your battery level when using this functionality for long periods of time.

Example:

      motorC = NXTMotor('C', 'Power', -100, 'TachoLimit', 0);
      motorC.SendToNXT();
      pause(4);      % wait 4 seconds
      motorC.Stop('brake');

See also

NXTMotor, WaitFor, StopMotor,

Signature