TestSandbox

From ROBOTC API Guide
Revision as of 17:09, 10 May 2012 by Bfeher (Talk | contribs)

Jump to: navigation, search

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]