Programming instructions
ROBOTC Natural Language - Cortex Quick Reference:
ROBOTC Natural Language - Cortex Quick Guide • 2
©
2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems
Until Potentiometer - Greater Than
The robot waits for the Potentiometer Sensor
to read a value greater than a set position.
Default threshold and sensor port: 2048, in6.
startMotor(port8, 63);
untilPotentiometerGreaterThan();
stop();
startMotor(port8, 63);
untilSonarGreaterThan(4000, in4);
stop();
Until Potentiometer - Less Than
The robot waits for the Potentiometer Sensor
to read a value less than a set position.
Default threshold and sensor port: 2048, in6.
startMotor(port8, 63);
untilPotentiometerLessThan();
stop();
startMotor(port8, 63);
untilSonarLessThan(40, in4);
stop();
Until Dark
The robot waits for the Light Sensor to read a
value less than the threshold.
Default threshold and sensor port: 505, in2.
startMotor();
untilDark();
stop();
startMotor(port8, 63);
untilDark(1005, in4);
stop();
Until Light
The robot waits for the Light Sensor to read a
value greater than the threshold.
Default threshold and sensor port: 505, in2.
startMotor();
untilLight();
stop();
startMotor(port8, 63);
untilLight(1005, in4);
stop();
Until Rotations
The robot waits for an encoder to reach a
specied number of rotations.
Default rotations, encoder: 1.0, dgtl1+2
startMotor();
untilRotations();
stop();
startMotor(port8, 63);
untilRotations(2.75, dgtl3);
stop();
Until Encoder Counts
The robot waits for an encoder to reach a
specied number of encoder counts.
Default counts, encoder: 360, dgtl1+2.
startMotor();
untilEncoderCounts();
stop();
startMotor(port8, 63);
untilEncoderCounts(990, dgtl3);
stop();
LED ON
Turn an LED in a specied digital port ON.
Default sensor port: dgtl2.
turnLEDOn();
wait();
turnLEDOff();
turnLEDOn(dgtl7);
wait(0.5);
turnLEDOff(dgtl7);
LED OFF
Turn an LED in a specied digital port OFF.
Default sensor port: dgtl2.
turnLEDOn();
wait();
turnLEDOff();
turnLEDOn(dgtl7);
wait(0.5);
turnLEDOff(dgtl7);
Flashlight ON
Turn a VEX Flashlight in a specied motor port
ON at a specied brightness.
Default motor port and brightness: port4, 63.
turnFlashlightOn();
wait();
turnFlashlightOff();
turnFlashlightOn(port10, 127);
wait(0.5);
turnFlashlightOff(port10);
Flashlight OFF
Turn a VEX Flashlight in a specied motor port
OFF.
Default motor port: port4.
turnFlashlightOn();
wait();
turnFlashlightOff();
turnFlashlightOn(port10, 127);
wait(0.5);
turnFlashlightOff(port10);
Robot Type
Choose which robot you are using (Recbot or
Swervebot).
Default bot: none.
robotType(); robotType(swervebot);
Go to Reference Links