
The velocity for the motor, which the nSpeed command is used for, and the port that the motor is plugged into. The nMotorIndex command identifies the name or port of the motor.Values for the motor velocity range from -100 (full reverse) to +100 (full forward).Sets the speed value of motor motor port A to stopped (0)īool waitUntilMotorStop ( tMotor nMotorIndex ) Sets the speed value of motor motor port A to half-speed backwards (-50) Halt program flow for 1000ms (1 second) #Robotc command list fullĪ zero value stops the motor.Ĭode Example: //Sets the speed value of motor motor port A to full forward (+100) This command will "sleep" your program until the specified motor (nMotorIndex) comes to a stop.You can use this command to avoid providing a wait time.Ĭode Example: //Sets the motorA's target to 1000 encoder counts at a speed value of 50.Void moveMotorTarget ( tMotor nMotorIndex ) Holds program flow until the motor on motor port A comes to a complete stop. Target incremental value that the motor will travel to. MoveMoterTarget(nMotorIndex, nPosition, nSpeed) Speed value that will be passed to the motor (-100 to +100). This command tells the robot to move a relative distance.The command needs three pieces of information: It will add (or subtract) distance from any previously specified targets. The motor, which is designated by the nMotorIndex command.The amount of degrees (incremental), which is designated by nPosition command.The third item is the velocity, which is designated by the nSpeed command.Setting either the target or the speed to a negative number will cause the motor to rotate backwards.At the end of this command, the motor will automatically come to a stop.Ĭode Example: //Moves the motor on motor port A 1000 degrees (forward).Void setMotorTarget ( tMotor nMotorIndex, float nPosition, int nspeed ) Moves the motor on motorA -1000 encoder counts (backwards) SetMotorTarget(nMotorIndex, nPosition, nSpeed) Target absolute value that the motor will travel to. This command tells the robot to move an absolute distance.
