Difference between revisions of "TestSandbox"

From ROBOTC API Guide
Jump to: navigation, search
Line 1: Line 1:
 
+
== Standard C data types: ==
<div style="overflow: hidden; border: 1px solid #CCC; background-color: #FAFAFA; text-align: center; width: 127px; height: 212px; padding: 4px 4px;">
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0" class="wikiText"
<div style="overflow: hidden; border: 1px solid blue; height: 125px; width: 125px; table-layout: fixed; vertical-align: middle; text-align: center;"><div style="overflow: hidden; border: 2px solid red; height: 125px; width: 125px; display: table-cell; vertical-align: middle; text-align: center;">[[Image:Tut-vex-speaker.jpg|125px]]</div></div>
+
|-
<div style="overflow: auto; background-color: orange; border: 0px solid green; text-align: center; width: 125px; height: 5px;"></div>
+
|
<div style="overflow: auto; border: 1px solid green; text-align: center; width: 125px; height: 76px;">{{#if:{{{title|}}} | {{#if:{{{link|}}} | [[{{{link}}}|'''{{{title}}}''']] | '''{{{title}}}''' }} | ''NO TITLE<br />NO TITLE<br />NO TITLE<br />NO TITLE''}}</div>
+
  {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:center; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000;" cellpadding="5%"
</div>
+
  ! 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
 +
  ! width="130px" style="background-color: green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}}
 +
  ! width="130px" style="background-color: green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}}
 +
  ! width="130px" style="background-color: green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex2}}
 +
  ! width="130px" style="background-color: green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-nxt}}
 +
  ! width="130px" style="background-color: green; text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-vex}}
 +
  ! width="130px" style="background-color: green; 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"|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).
 +
  | width="110px" 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="110px" 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="110px" 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}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  | 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.
 +
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}}
 +
  |-
 +
  | 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"|A floating-point number (decimal) with the following length and accuracy restrictions:<br />
 +
{| 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"|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.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.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.0 to +2,097,200.0
 +
    |-
 +
    |}
 +
  | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
 +
  |-
 +
  | 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"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 1px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  | 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:right; border-style: solid; border-width: 0px 0px 0px 0px"|{{tag-arduino328}} {{tag-arduinoMega}} {{tag-nxt}} {{tag-tetrix}} {{tag-vex2}} {{tag-vex}}
 +
  |-
 +
  |}
 +
|}
 +
<br />

Revision as of 15:27, 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] [nxt] [tetrix] [cortex] [pic]
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] [nxt] [tetrix] [cortex] [pic]
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] [nxt] [tetrix] [cortex]
long A whole number ranging from -2,147,483,648 to 2,147,483,647. [arduino Mega] [nxt] [tetrix] [cortex]
int A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [nxt] [tetrix] [cortex] [pic]
short A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [nxt] [tetrix] [cortex] [pic]
string A sequence of characters. [arduino Mega] [nxt] [tetrix] [cortex]
word A whole number ranging from -32,768 to 32,767. [arduino 328] [arduino Mega] [nxt] [tetrix] [cortex] [pic]
ubyte An unsigned byte (0 to 255). [arduino 328] [arduino Mega] [nxt] [tetrix] [cortex] [pic]
void This means that the function doesn't return anything. [arduino 328] [arduino Mega] [nxt] [tetrix] [cortex] [pic]