Programming instructions

Reference
Project Lead The Way
©
and Carnegie Mellon Robotics Academy
©
/ For use with VEX
®
Robotics Systems
Reserved Words 2
Reserved Words
int x; //Integer variable x
x=time1[T1]; //Assigns x=value of Timer 1 (1/1000 sec.)
motor[port3]= 127; //port3 - full speed forward
wait10Msec(200); //Wait 2 seconds
motor[port3]= 0; //port3 - off
int x; //Integer variable x
x=time10[T1]; //Assigns x=value of Timer 1 (1/100 sec.)
wait10Msec(wait_time);
This code will cause the robot to wait a specied number of hundredths of seconds before
executing the next instruction in a program. “wait_time” is an integer value (where 1 = 1/100th of
a second). Maximum wait_time is 32768, or 327.68 seconds.
time1[timer]
This code returns the current value of the referenced timer as an integer. The resolution for
“time1” is in milliseconds (1 = 1/1000th of a second).
The maximum amount of time that can be referenced is 32.768 seconds (~1/2 minute)
The VEX has 4 internal timers: T1, T2, T3, and T4
time10[timer]
This code returns the current value of the referenced timer as an integer. The resolution for
“time10” is in hundredths of a second (1 = 1/100th of a second).
The maximum amount of time that can be referenced is 327.68 seconds (~5.5 minutes)
The VEX has 4 internal timers: T1, T2, T3, and T4
int x; //Integer variable x
x=time100[T1]; //assigns x=value of Timer 1 (1/10 sec.)
time100[timer]
This code returns the current value of the referenced timer as an integer. The resolution for
“time100” is in tenths of a second (1 = 1/10th of a second).
The maximum amount of time that can be referenced is 3276.8 seconds (~54 minutes)
The VEX has 4 internal timers: T1, T2, T3, and T4
Go to Reference Links