Difference between revisions of "TestSandbox"

From ROBOTC API Guide
Jump to: navigation, search
(Standard C data types:)
Line 6: Line 6:
 
   ! style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|''data type''
 
   ! style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|''data type''
 
   ! style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Comments
 
   ! style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Comments
   ! width="130px" style="green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
+
   ! width="115px" style="green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
   ! width="130px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
+
   ! width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
   ! width="130px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
+
   ! width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
   ! width="130px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
+
   ! width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
   ! width="130px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
+
   ! width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
   ! width="130px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
+
   ! width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 1px 0px 1px 0px"|<span class="keywordBI" id="dataType_bool">bool</span>
 
   | style="text-align:left; border-style: solid; border-width: 1px 0px 1px 0px"|<span class="keywordBI" id="dataType_bool">bool</span>
 
   | style="text-align:left; border-style: solid; border-width: 1px 0px 1px 0px"|A Boolean value; either <span class="keywordBI">true</span> or <span class="keywordBI">false</span>.
 
   | style="text-align:left; border-style: solid; border-width: 1px 0px 1px 0px"|A Boolean value; either <span class="keywordBI">true</span> or <span class="keywordBI">false</span>.
 
Note that <span class="keywordBI">false</span> is equivalent to zero (0), and <span class="keywordBI">true</span> is equivalent to any non-zero number (both positive and negative).
 
Note that <span class="keywordBI">false</span> is equivalent to zero (0), and <span class="keywordBI">true</span> is equivalent to any non-zero number (both positive and negative).
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-arduino328}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-arduino328}}
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-arduinoMega}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-arduinoMega}}
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-vex2}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-vex2}}
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-nxt}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-nxt}}
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-vex}}
   | width="110px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-tetrix}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 1px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_byte">byte</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_byte">byte</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -128 to 127.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -128 to 127.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_char">char</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_char">char</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -128 to 127.  Can be interpreted as a character value.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -128 to 127.  Can be interpreted as a character value.
 
For example, <span class="codeStringsNums">42</span> = '<span class="codeStringsNums">B</span>' and vice versa.
 
For example, <span class="codeStringsNums">42</span> = '<span class="codeStringsNums">B</span>' and vice versa.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_float">float</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_float">float</span>
Line 51: Line 61:
 
     |-
 
     |-
 
     |}
 
     |}
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_long">long</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_long">long</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -2,147,483,648 to 2,147,483,647.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -2,147,483,648 to 2,147,483,647.
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_int">int</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_int">int</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_short">short</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_short">short</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_string">string</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_string">string</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A sequence of characters.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A sequence of characters.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_word">word</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordBI" id="dataType_word">word</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|A whole number ranging from -32,768 to 32,767.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordB" id="dataType_ubyte">ubyte</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|<span class="keywordB" id="dataType_ubyte">ubyte</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|An unsigned byte (0 to 255).
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|An unsigned byte (0 to 255).
   | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 0px 0px"|<span class="keywordBI" id="dataType_void">void</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 0px 0px"|<span class="keywordBI" id="dataType_void">void</span>
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 0px 0px"|This means that the function doesn't return anything.
 
   | style="text-align:left; border-style: solid; border-width: 0px 0px 0px 0px"|This means that the function doesn't return anything.
   | style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
+
   | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-arduino328}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-arduinoMega}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-vex2}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-nxt}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-vex}}
 +
  | width="115px" style="text-align:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-tetrix}}
 
   |-
 
   |-
 
   |}
 
   |}
 
|}
 
|}
 
<br />
 
<br />

Revision as of 17:09, 10 May 2012

Standard C data types:

data type Comments [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
bool A Boolean value; either true or false.

Note that false is equivalent to zero (0), and true is equivalent to any non-zero number (both positive and negative).

[arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
byte A whole number ranging from -128 to 127. [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
char A whole number ranging from -128 to 127. Can be interpreted as a character value.

For example, 42 = 'B' and vice versa.

[arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
float A floating-point number (decimal) with the following length and accuracy restrictions:
0.#### 0.0000 to +2,048.0000
0.### 0.000 to +32,768.000
0.## 0.00 to +262,144.00
0.# 0.0 to +2,097,200.0
[arduino Mega] [cortex] [nxt] [tetrix]
long A whole number ranging from -2,147,483,648 to 2,147,483,647. [arduino Mega] [cortex] [nxt] [tetrix]
int A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
short A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
string A sequence of characters. [arduino Mega] [cortex] [nxt] [tetrix]
word A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
ubyte An unsigned byte (0 to 255). [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]
void This means that the function doesn't return anything. [arduino 328] [arduino Mega] [cortex] [nxt] [pic] [tetrix]