|
|
| Line 870: |
Line 870: |
| | {| 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">untilBump</span><span class="bigCodePunc">(</span><span class="bigKeywordB">tSensors </span><span class="bigCodeBasic">sensorPort</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">dgtl6</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">int </span><span class="bigCodeBasic">delayTimeMS</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">10</span><span class="bigCodePunc">)</span> | + | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">untilBump</span><span class="bigCodePunc">(</span><span class="bigKeywordB">tSensors </span><span class="bigCodeBasic">sensorPort</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">int </span><span class="bigCodeBasic">delayTimeMS</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">10</span><span class="bigCodePunc">)</span> |
| | |- | | |- |
| | | | | | |
| Line 880: |
Line 880: |
| | | style="border-style: solid; border-width: 0px 0px 0px 0px"|([[Data_Types#dataType_void|void]]) The robot does what it was doing until the touch sensor is pressed in and then released out. A delay time in milliseconds can be specified. | | | style="border-style: solid; border-width: 0px 0px 0px 0px"|([[Data_Types#dataType_void|void]]) The robot does what it was doing until the touch sensor is pressed in and then released out. A delay time in milliseconds can be specified. |
| | | | |
| − | Acceptable Sensors: digital ports 1 through 12 (and your names for them given in Motors and Sensors Setup.) | + | Acceptable Sensors: A/D ports 1 through 16 (and your names for them given in Motors and Sensors Setup.) |
| | | | |
| | Acceptable Range for Delay Time: | | Acceptable Range for Delay Time: |
| − | 0 to 2,147,483,647. | + | 0 to 32,767. |
| | |- | | |- |
| | |} | | |} |
| Line 894: |
Line 894: |
| | |- | | |- |
| | | 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 light sensor.<br />(default: <span class="codeStringsNums">dgtl6</span>) | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|The sensor port to use for the light sensor.<br />(default: '''''none''''') |
| − | | 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">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"|''delayTimeMS'' | | | style="border-style: solid; border-width: 0px 0px 0px 0px"|''delayTimeMS'' |
| | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The amount of milliseconds that MUST PASS between<br />press and release of the sensor for it to count.<br />(default: <span class="codeStringsNums">10</span>) | | | style="border-style: solid; border-width: 0px 0px 0px 0px"|The amount of milliseconds that MUST PASS between<br />press and release of the sensor for it to count.<br />(default: <span class="codeStringsNums">10</span>) |
| − | | style="border-style: solid; border-width: 0px 0px 0px 0px"|Any whole integer amount from<br />0 to 2,147,483,647. | + | | style="border-style: solid; border-width: 0px 0px 0px 0px"|Any whole integer amount from<br />0 to 32,767. |
| | |- | | |- |
| | |} | | |} |
| Line 909: |
Line 909: |
| | | 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"> |
| | forward(); | | forward(); |
| − | untilBump(); /* wait until the touch sensor in port dgtl6 is pressed and | + | untilBump(in10); /* wait until the touch sensor in port in10 is pressed and |
| − | then released with a delay time of 10 milliseconds (default) */
| + | then released with a delay time of 10 milliseconds (default) */ |
| | stop(); | | stop(); |
| | </syntaxhighlight> | | </syntaxhighlight> |
| Line 921: |
Line 921: |
| | |- | | |- |
| | | 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"> |
| − | forward(63); // go forward at speed 63 | + | forward(63); // go forward at speed 63 |
| − | untilBump(dgtl10, 100); /* wait until the touch sensor in port dgtl10 is pressed and | + | untilBump(in10, 100); /* wait until the touch sensor in port in10 is pressed and |
| − | then released with a delay time of 100 milliseconds */
| + | then released with a delay time of 100 milliseconds */ |
| − | stop(); // stop | + | stop(); // stop |
| | </syntaxhighlight> | | </syntaxhighlight> |
| | |- | | |- |