VEX2 Natural Language
(→untilButtonPress) |
(→Setup Functions) |
||
| Line 42: | Line 42: | ||
== Setup Functions == | == Setup Functions == | ||
| − | + | === robotType === | |
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | {| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
|- | |- | ||
Revision as of 13:14, 24 February 2012
|
Main >> CORTEX >> Natural Language |
| The ROBOTC Natural Language Library aims at making learning and using text-based programming languages easier for beginners. The Natural Language Library is filled with commands that are both easy to use and easy to remember. Natural Language commands encompass entire robot behaviors into a single command.
Natural Language can be enabled in ROBOTC by going to the Robot menu, then Platform Type, and then by selecting one of the Natural Language options. |
|
| |||||||
Video
| This video explains the ROBOTC Natural Language:
|
Setup Functions
robotType
| void robotType(tRobotType type = none) | ||||||
| ||||||
| ||||||
| ||||||
|
Wait Functions
wait
| void wait(float waitTime = 1.0) | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
|
waitInMilliseconds
| void waitInMilliseconds(long waitTime = 1000) | ||||||
| ||||||
| ||||||
| ||||||
|
Movement Functions
startMotor
| void startMotor(tMotor motorPort = port6, byte speed = 95) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
stopMotor
| void stopMotor(tMotor motorPort = port6) | ||||||
| ||||||
| ||||||
| ||||||
|
setServo
| void setServo(tMotor servoPort = port6, int position = 0) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
Robot Movement Functions
forward
| void forward(byte speed = 95) | ||||||
| ||||||
| ||||||
| ||||||
|
backward
| void backward(byte speed = -95) | ||||||
| ||||||
| ||||||
| ||||||
|
pointTurn
| void pointTurn(tDirections direction = right, byte speed = 95) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
swingTurn
| void swingTurn(tDirections direction = right, byte speed = 95) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
stop
| void stop() | ||||
| ||||
| ||||
|
lineTrackForTime
| void lineTrackForTime(float trackTime = 5.0, int threshold = 505, tSensors sensorLeft = in1, tSensors sensorCenter = in2, tSensors sensorRight = in3) | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
|
lineTrackForRotations
| void lineTrackForRotations(float rotations = 3.0, int threshold = 505, tSensors sensorLeft = in1, tSensors sensorCenter = in2, tSensors sensorRight = in3) | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
|
moveStraightForTime
| void moveStraightForTime(float seconds = 5.0, tMotor rightEncoderPort = dgtl1, tMotor leftEncoderPort = dgtl3) | ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
|
moveStraightForRotations
| void moveStraightForRotations(float rotations = 1.0, tMotor rightEncoderPort = dgtl1, tMotor leftEncoderPort = dgtl3) | ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
|
tankControl
| void tankControl(TVexJoysticks rightJoystick = Ch2, TVexJoysticks leftJoystick = Ch3, short threshold = 10) | ||||||||||||
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
arcadeControl
| void arcadeControl(TVexJoysticks verticalJoystick = Ch2, TVexJoysticks horizontalJoystick = Ch1, short threshold = 10) | ||||||||||||
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
Until Functions
untilTouch
| void untilTouch(tSensors sensorPort = dgtl6) | ||||||
| ||||||
| ||||||
| ||||||
|
untilRelease
| void untilRelease(tSensors sensorPort = dgtl6) | ||||||
| ||||||
| ||||||
| ||||||
|
untilBump
| void untilBump(tSensors sensorPort = dgtl6, int delayTimeMS = 10) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilSonarGreaterThan
| void untilSonarGreaterThan(short distance = 30, tSensors sensorPort = dgtl8) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilSonarLessThan
| void untilSonarLessThan(short distance = 30, tSensors sensorPort = dgtl8) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilPotentiometerGreaterThan
| void untilPotentiometerGreaterThan(int position = 2048, tSensors sensorPort = in6) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilPotentiometerLessThan
| void untilPotentiometerLessThan(int position = 2048, tSensors sensorPort = in6) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilButtonPress
| void untilButtonPress(short button = centerBtnVEX) | ||||||
| ||||||
| ||||||
| ||||||
|
untilLight
| void untilLight(int threshold = 30, tSensors sensorPort = S3) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilDark
| void untilDark(int threshold = 30, tSensors sensorPort = S3) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilRotations
| void untilRotations(float rotations = 1.0, tMotor motorPort = motorB) | |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
|
untilEncoderCounts
| void untilEncoderCounts(long distance = 360, tMotor motorPort = motorB) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|


























