|
|
| Line 688: |
Line 688: |
| | |- | | |- |
| | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''seconds'' | | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''seconds'' |
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The amount of time in seconds to drive straight forward.<br />(default: <span class="codeStringsNums">5.0</span>) | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The amount of time in seconds to drive straight forward.<br />(default: '''NONE''') |
| | | style="border-style: solid; border-width: 1px 0px 1px 0px"|Any integer amount from<br />0 to +2,147,483,647. | | | style="border-style: solid; border-width: 1px 0px 1px 0px"|Any integer amount from<br />0 to +2,147,483,647. |
| | |- | | |- |
| Line 732: |
Line 732: |
| | *NOTE: This function only supports moving forward and only at one speed setting. Future implementations may include moving backwards and variable speeds. | | *NOTE: This function only supports moving forward and only at one speed setting. Future implementations may include moving backwards and variable speeds. |
| | | | |
| − | Acceptable Sensors: digital ports 1 through 11 (and your names for them given in Motors and Sensors Setup.) | + | Acceptable Sensors: A/D ports 1 through 16 + interrupts (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="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"|Parameter |
| | ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation | | ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation |
| Line 743: |
Line 743: |
| | |- | | |- |
| | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''rotations'' | | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''rotations'' |
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The amount of axle rotations to drive straight forward.<br />(default: <span class="codeStringsNums">1.0</span>) | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The amount of axle rotations to drive straight forward.<br />(default: '''NONE''') |
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"|Any floating point amount: | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|Any integer amount from<br />0 to +2,147,483,647. |
| − | {| 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 0px 0px"|
| + | |
| − | !
| + | |
| − | |-
| + | |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|0.####
| + | |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|-2,048.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"|-32,768.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"|-262,144.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"|-2,097,200.0 to +2,097,200.0
| + | |
| − | |-
| + | |
| − | |}
| + | |
| | |- | | |- |
| | | style="border-style: solid; border-width: 0px 0px 1px 0px"|''rightEncoderPort'' | | | style="border-style: solid; border-width: 0px 0px 1px 0px"|''rightEncoderPort'' |
| − | | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-side motor encoder.<br />(default: <span class="codeStringsNums">dgtl1</span> [+ <span class="codeStringsNums">dgtl2</span>]) | + | | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-side motor encoder.<br />(default: '''NONE''') |
| − | | style="border-style: solid; border-width: 0px 0px 1px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl11</span><br />Or their names setup in Motors and Sensors Setup. | + | | style="border-style: solid; border-width: 0px 0px 1px 0px"|<span class="codeStringsNums">in1</span> to <span class="codeStringsNums">in16</span><br />Or their names setup in Motors and Sensors Setup. |
| | |- | | |- |
| | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''leftEncoderPort'' | | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''leftEncoderPort'' |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The left-side motor encoder.<br />(default: <span class="codeStringsNums">dgtl3</span> [+ <span class="codeStringsNums">dgtl4</span>]) | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The left-side motor encoder.<br />(default: '''NONE''') |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|<span class="codeStringsNums">dgtl1</span> to <span class="codeStringsNums">dgtl11</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">in16</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">
| + | |
| − | moveStraightForRotations(); /* move straight forward for 1.0 rotations,
| + | |
| − | using dgtl1 (+ dgtl2) as the right-side encoder and
| + | |
| − | dgtl3 (+ dgtl4) as the left-side encoder (default) */
| + | |
| − | stop();
| + | |
| − | </syntaxhighlight>
| + | |
| | |- | | |- |
| | |} | | |} |
| Line 791: |
Line 761: |
| | |- | | |- |
| | | 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"> |
| − | moveStraightForRotations(4.95, dgtl5, dgtl3); /* move straight forward for 4.95 rotations, | + | moveStraightForRotations(4, in5, in3); /* move straight forward for 4 rotations, |
| − | using dgtl5 (+ dgtl6) as the right-side encoder
| + | using in5 as the right-side encoder |
| − | and dgtl3 (+ dgtl4) as the left-side encoder */
| + | and in3 as the left-side encoder */ |
| − | stop(); // stop | + | stop(); // stop |
| | </syntaxhighlight> | | </syntaxhighlight> |
| | |- | | |- |
| 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.
|