NXT_SetOutputState

Sends previously specified settings to current active motor.

Contents

Syntax

status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)

status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)

Description

status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode) sends the given settings like motor port (MOTOR_A, MOTOR_B or MOTOR_C), the power (-100...100, the IsMotorOn boolean flag, the IsBrake boolean flag, the regulation mode name RegModeName ('IDLE', 'SYNC', 'SPEED'), the TurnRatio (-100...100), the RunStateName ('IDLE', 'RUNNING', 'RAMUP', 'RAMPDOWN'), the TachoLimit (angle limit) in degrees, and the ReplyMode. By the ReplyMode one can request an acknowledgement for the packet transmission. The two strings 'reply' and 'dontreply' are valid. The return value status indicates if an error occures by the packet transmission.

status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle) uses the given NXT connection handle. This should be a serial handle on a PC system and a file handle on a Linux system.

Example

   NXT_SetOutputState(MOTOR_A, 80, true, true, 'SPEED', 0, 'RUNNING', 360, 'dontreply');

See also

DirectMotorCommand, NXT_GetOutputState, ReadFromNXT, MOTOR_A, MOTOR_B, MOTOR_C,

Signature