Programming instructions

ROBOTC Natural Language - Cortex Quick Reference:
ROBOTC Natural Language - Cortex Quick Guide 3
©
2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems
Forward
The robot drives straight forward.
Default speed: 95.
forward();
wait();
stop();
forward(63);
wait(2.0);
stop();
Backward
The robot drives straight backward.
Default speed: -95.
backward();
wait();
stop();
backward(63);
wait(2.0);
stop();
Point Turn
The robot makes a sharp turn in place.
Default direction and speed: right, 95.
pointTurn();
wait();
stop();
pointTurn(left, 63);
wait(0.4);
stop();
Swing Turn
The robot makes a wide turn, activating only
one drive motor.
Default direction and speed: right, 95.
swingTurn();
wait();
stop();
swingTurn(left, 63);
wait(0.75);
stop();
Stop
The robot halts both driving motors, coming to
a stop.
forward();
wait();
stop();
forward(63);
wait(2.0);
stop();
Line Track - for Time
The robot tracks a dark line on a light surface
for a specied time in seconds.
Default time, threshold, sensors: 5.0, 505, in1, in2, in3 (Left, Center,
lineTrackForTime();
stop();
lineTrackForTime(7.5, 99, in6, in7, in8);
stop();
Line Track - for Rotations
The robot tracks a dark line on a light surface
for a specied distance in rotations.
Default time, threshold, sensors: 3.0, 505, in1, in2, in3 (Left, Center,
lineTrackForRotations();
stop();
lineTrackForRotations(4.75, 99, in6, in7, in8);
stop();
Move Straight - for Time
The robot will use encoders to maintain a
straight path for a specied time in seconds.
Default time, rightEncoder, leftEncoder: 5.0, dgtl1+2, dgtl3+4.
moveStraightForTime();
stop();
moveStraightForTime(7.5, dgtl5, dgtl3);
stop();
Move Straight - for Rotations
The robot will use encoders to maintain a straight
path for a specied distance in encoder rotations.
Default rotations, rightEncoder, leftEncoder: 1.0, dgtl1+2, dgtl3+4.
moveStraightForRotations();
stop();
moveStraightForRotations(4.75, dgtl5, dgtl3);
stop();
Tank Control
The robot is remote controlled with the right motor mapped to
the right joystick and the left motor mapped to the left joystick.
Default right and left and joystick: Ch2, Ch3.
while(true)
{
tankControl();
}
while(true)
{
tankControl(Ch1, Ch4);
}
Arcade Control
The robot is remote controlled with both
motors mapped to a single joystick.
Default vertical and horizontal joysticks: Ch2, Ch1.
while(true)
{
arcadeControl();
}
while(true)
{
arcadeControl(Ch1, Ch4);
}
Go to Reference Links