VEX Natural Language
(→moveStraightForTime) |
(→moveStraightForTime) |
||
| Line 709: | Line 709: | ||
using in5 as the right-side encoder | using in5 as the right-side encoder | ||
and in3 as the left-side encoder */ | and in3 as the left-side encoder */ | ||
| − | stop(); | + | stop(); // stop |
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
Revision as of 11:04, 16 March 2012
|
Main >> PIC >> 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() | ||||
| ||||
| ||||
|
moveStraightForTime
| void moveStraightForTime(long seconds, tSensors rightEncoderPort, tSensors leftEncoderPort) | ||||||||||||
| ||||||||||||
| ||||||||||||
|
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 = 505, tSensors sensorPort = in2) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilDark
| void untilDark(int threshold = 505, tSensors sensorPort = in2) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
untilRotations
| void untilRotations(float rotations = 1.0, tSensors sensorPort = dgtl1) | |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
|
untilEncoderCounts
| void untilEncoderCounts(long distance = 360, tSensors sensorPort = dgtl1) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
Special Functions
turnLEDOn
| void turnLEDOn(tSensors sensorPort = dgtl2) | ||||||
| ||||||
| ||||||
| ||||||
|
turnLEDOff
| void turnLEDOff(tSensors sensorPort = dgtl2) | ||||||
| ||||||
| ||||||
| ||||||
|
turnFlashlightOn
| void turnFlashlightOn(tMotor flashlightPort = port4, short brightness = 63) | |||||||||
| |||||||||
| |||||||||
| |||||||||
|
turnFlashlightOff
| void turnFlashlightOff(tMotor flashlightPort = port4) | ||||||
| ||||||
| ||||||
| ||||||
|






























