ROBOTC for MINDSTORMS - Movement Functions  

ROBOTC Natural Language - TETRIX: (PDF) 

Movement Functions:
Title Picture Description Default Usage and Sample Usage and Sample with Parameters

Start Motor Start Motor Set a motor to a speed.

Range: -100 to 100

Acceptable Motors: ports A through C,
(and your names for them given in Motors and Sensors Setup.)

startMotor(motor, speed)
default motor: motorA
default speed: 75

startMotor();
wait();
stopMotor();


startMotor(motor, speed)
To set motorB to speed -25 for 0.5 seconds:

startMotor(motorB, -25);
wait(0.5);
stopMotor(motorB);



Stop Motor
Stop Motor Stops a motor.

Acceptable Motors: ports A through C,
(and your names for them given in Motors and Sensors Setup.)

stopMotor(motor)
default motor: motorA

startMotor();
wait();
stopMotor();


stopMotor(motor)
To stop a motor in motorB:

startMotor(motorB, -25);
wait(0.5);
stopMotor(motorB);


Set Servo
Stop Motor Set a servo to a desired position.

Acceptable Servos: servo-ports 1 through 24, (and your names for them given in Motors and Sensors Setup.)

setServo(servo, position)
default servo: srvo_S1_C1_1

setServo();


setServo(servo, position)
To set a servo on servo-port 6 to position 37:

setServo(srvo_S1_C1_6, 37);



(print me in landscape mode)

 

 


Copyright © 2012 Robotics Academy/Robomatter - http://robotc.net/