VEX2 Natural Language
(→Special Functions) |
(→turnFlashlightOn) |
||
| (22 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | <yambe:breadcrumb self="Natural Language">VEX2|CORTEX</yambe:breadcrumb> | |
| − | + | <br /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | {| | |
| − | {| | + | |
|- | |- | ||
|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. | |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. | ||
| Line 14: | Line 9: | ||
|- | |- | ||
|} | |} | ||
| + | <br /> | ||
| − | { | + | {{tl|1|1}} |
| − | + | <br /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
== Video == | == Video == | ||
| Line 126: | Line 108: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0000 to +2,048.0000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.000 to +32,768.000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.00 to +262,144.00 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0 to +2,097,200.0 |
|- | |- | ||
|} | |} | ||
| Line 191: | Line 173: | ||
| style="border-style: solid; border-width: 1px 0px 0px 0px"|''waitTime'' | | style="border-style: solid; border-width: 1px 0px 0px 0px"|''waitTime'' | ||
| style="border-style: solid; border-width: 1px 0px 0px 0px"|Amount of time to wait, in seconds.<br />(default: <span class="codeStringsNums">1000</span>) | | style="border-style: solid; border-width: 1px 0px 0px 0px"|Amount of time to wait, in seconds.<br />(default: <span class="codeStringsNums">1000</span>) | ||
| − | | style="border-style: solid; border-width: 1px 0px 0px 0px"|Any | + | | style="border-style: solid; border-width: 1px 0px 0px 0px"|Any integer amount from<br />0 to +2,147,483,647. |
|- | |- | ||
|} | |} | ||
| Line 712: | Line 694: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0000 to +2,048.0000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.000 to +32,768.000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.00 to +262,144.00 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0 to +2,097,200.0 |
|- | |- | ||
|} | |} | ||
| Line 872: | Line 854: | ||
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | {| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
|- | |- | ||
| − | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">moveStraightForTime</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">float </span><span class="bigCodeBasic">seconds</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">5.0</span><span class="bigCodePunc">, </span><span class="bigCodeBasic"> | + | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">moveStraightForTime</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">float </span><span class="bigCodeBasic">seconds</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">5.0</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">tSensors </span><span class="bigCodeBasic">rightEncoderPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">dgtl1</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">tSensors </span><span class="bigCodeBasic">leftEncoderPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">dgtl3</span><span class="bigCodePunc">)</span> |
|- | |- | ||
| | | | ||
| Line 902: | Line 884: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.#### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0000 to +2,048.0000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.### | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.000 to +32,768.000 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.## | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.00 to +262,144.00 |
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.# | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.0 to +2,097,200.0 |
|- | |- | ||
|} | |} | ||
| Line 957: | Line 939: | ||
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | {| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
|- | |- | ||
| − | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">moveStraightForRotations</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">float </span><span class="bigCodeBasic">rotations</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">1.0</span><span class="bigCodePunc">, </span><span class="bigCodeBasic"> | + | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">moveStraightForRotations</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">float </span><span class="bigCodeBasic">rotations</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">1.0</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">tSensors </span><span class="bigCodeBasic">rightEncoderPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">dgtl1</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">tSensors </span><span class="bigCodeBasic">leftEncoderPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">dgtl3</span><span class="bigCodePunc">)</span> |
|- | |- | ||
| | | | ||
| Line 1,208: | Line 1,190: | ||
|- | |- | ||
| style="border-style: solid; border-width: 1px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 1px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 1px 0px 0px 0px"|The sensor port to use for the touch sensor.<br />(default: <span class="codeStringsNums">dgtl6</span>) |
| style="border-style: solid; border-width: 1px 0px 0px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 1px 0px 0px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,264: | Line 1,246: | ||
|- | |- | ||
| style="border-style: solid; border-width: 1px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 1px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 1px 0px 0px 0px"|The sensor port to use for the touch sensor.<br />(default: <span class="codeStringsNums">dgtl6</span>) |
| style="border-style: solid; border-width: 1px 0px 0px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 1px 0px 0px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,323: | Line 1,305: | ||
|- | |- | ||
| style="border-style: solid; border-width: 1px 0px 1px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The sensor port to use for the touch sensor.<br />(default: <span class="codeStringsNums">dgtl6</span>) |
| style="border-style: solid; border-width: 1px 0px 1px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 1px 0px 1px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl12</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,519: | Line 1,501: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the potentiometer sensor.<br />(default: <span class="codeStringsNums">in6</span>) |
| style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,583: | Line 1,565: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the potentiometer sensor.<br />(default: <span class="codeStringsNums">in6</span>) |
| style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,706: | Line 1,688: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the potentiometer sensor.<br />(default: <span class="codeStringsNums">in2</span>) |
| style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,770: | Line 1,752: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The sensor port to use for the potentiometer sensor.<br />(default: <span class="codeStringsNums">in2</span>) |
| style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in8</span><br />Or their names setup in Motors and Sensors Setup. | ||
|- | |- | ||
| Line 1,876: | Line 1,858: | ||
forward(63); // move forward at speed 63 | forward(63); // move forward at speed 63 | ||
untilRotations(2.75, dgtl3); /* wait until the quadrature encoder in port | untilRotations(2.75, dgtl3); /* wait until the quadrature encoder in port | ||
| − | dgtl3 (+ dgtl4)counts 2.75 rotations */ | + | dgtl3 (+ dgtl4) counts 2.75 rotations */ |
stop(); // stop | stop(); // stop | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 1,940: | Line 1,922: | ||
forward(63); // move forward at speed 63 | forward(63); // move forward at speed 63 | ||
untilEncoderCounts(990, dgtl3); /* wait until the quadrature encoder in port | untilEncoderCounts(990, dgtl3); /* wait until the quadrature encoder in port | ||
| − | dgtl3 (+ dgtl4)counts 990 encoder counts */ | + | dgtl3 (+ dgtl4) counts 990 encoder counts */ |
stop(); // stop | stop(); // stop | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 2,071: | Line 2,053: | ||
Acceptable Ports: motor ports 1 through 10 (and your names for them given in Motors and Sensors Setup.) | Acceptable Ports: motor ports 1 through 10 (and your names for them given in Motors and Sensors Setup.) | ||
| − | + | NOTE: Brightness control only available in motor ports 1 and 10, or 2 through 9 when connected to a VEX Motor Controller 29. | |
|- | |- | ||
|} | |} | ||
| Line 2,086: | Line 2,068: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|''brightness'' | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''brightness'' | ||
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The level of brightness to | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The level of brightness to<br />set the VEX Flashlight to.<br />(default: <span class="codeStringsNums">63</span>) |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"| | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|Any whole integer amount from 0 to 127. |
|- | |- | ||
|} | |} | ||
| Line 2,106: | Line 2,088: | ||
|- | |- | ||
| style="border-style: solid; border-width: 0px 0px 0px 0px"|<syntaxhighlight lang="ROBOTC"> | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<syntaxhighlight lang="ROBOTC"> | ||
| − | turnFlashlightOn(); // turn VEX Flashlight in port10 ON to full brightness [127] | + | turnFlashlightOn(port10, 127); // turn VEX Flashlight in port10 ON to full brightness [127] |
| + | </syntaxhighlight> | ||
| + | |- | ||
| + | |} | ||
| + | |- | ||
| + | |} | ||
| + | <br /> | ||
| + | |||
| + | === turnFlashlightOff === | ||
| + | {| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
| + | |- | ||
| + | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">turnFlashlightOff</span><span class="bigCodePunc">(</span><span class="bigCodeBasic">tMotor </span><span class="bigCodeBasic">flashlightPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">port4</span><span class="bigCodePunc">)</span> | ||
| + | |- | ||
| + | | | ||
| + | {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 0px; border-style: solid; border-color: #000;" cellpadding="5%" | ||
| + | ! style="border-style: solid; border-width: 0px 0px 0px 0px"| | ||
| + | ! style="border-style: solid; border-width: 0px 0px 0px 0px"| | ||
| + | |- | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[File:flashlight_off.png]] | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|([[Data_Types#dataType_void|void]]) Turns a VEX Flashlight in a specfied motor port OFF. | ||
| + | |||
| + | Acceptable Ports: motor ports 1 through 10 (and your names for them given in Motors and Sensors Setup.) | ||
| + | |||
| + | |- | ||
| + | |} | ||
| + | |- | ||
| + | | | ||
| + | {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#F2F2F2; text-align:left; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 0px; border-style: solid; border-color: #000;" cellpadding="5%" | ||
| + | ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter | ||
| + | ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation | ||
| + | ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Acceptable Input | ||
| + | |- | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sensorPort'' | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The VEX Flashlight to use.<br />(default: <span class="codeStringsNums">port4</span>) | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">port1</span> to <span class="codeStringsNums">port10</span><br />Or their names setup in Motors and Sensors Setup. | ||
| + | |- | ||
| + | |} | ||
| + | |- | ||
| + | | | ||
| + | {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 0px; border-style: solid; border-color: #000;" cellpadding="5%" | ||
| + | ! style="border-style: solid; border-width: 0px 0px 0px 0px"|Default Usage and Sample | ||
| + | |- | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<syntaxhighlight lang="ROBOTC"> | ||
| + | turnFlashlightOff(); // turn VEX Flashlight in port4 OFF (default) | ||
| + | </syntaxhighlight> | ||
| + | |- | ||
| + | |} | ||
| + | |- | ||
| + | | | ||
| + | {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 0px; border-style: solid; border-color: #000;" cellpadding="5%" | ||
| + | ! style="border-style: solid; border-width: 0px 0px 0px 0px"|Usage and Sample with Parameters | ||
| + | |- | ||
| + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<syntaxhighlight lang="ROBOTC"> | ||
| + | turnFlashlightOff(port10); // turn VEX Flashlight in port10 OFF | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
Latest revision as of 12:41, 30 April 2012
| 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, tSensors rightEncoderPort = dgtl1, tSensors leftEncoderPort = dgtl3) | ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
|
moveStraightForRotations
| void moveStraightForRotations(float rotations = 1.0, tSensors rightEncoderPort = dgtl1, tSensors 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) | ||||||
| ||||||
| ||||||
| ||||||
|
































