Arduino C / C++

Data Types

Type Byte length Range of values
void 0
boolean 1 true / false
char 1 -128 to +127
unsigned char 1 0 to 255
byte 1 0 to 255
int 2 -32,768 to 32,767
unsigned int 2 0 to 65535
word 2 0 to 65535
long 4 -2,147,483,648 to 2,147,483,647
unsigned long 4 0 to 4,294,967,295
float 4 -3.4028235E+37 to +3.4028235E+37
double 4 -3.4028235E+37 to +3.4028235E+37
string
null terminated string - character array
String
string object
array
sequence of values

// examples
float pi = 3.14;
char name[] = "John";
int vals[20];  // 0..19
// String Data Type
String name = "John";