Thursday, October 25, 2012

Arduino Uno - Data type size

For whatever reason, I simply can’t remember the size and range of the data types Arduino offers. So I have created a small sketch that prints them out.

Here is the result:

--- Variable type: Size in SRAM (bytes) ---
uint8_t: 1
boolean: 1
char: 1
unsigned char: 1
byte: 1
int: 2
unsigned int: 2
word: 2
long: 4
unsigned long: 4
float: 4
double: 4

The sketch with all details can be viewed at Github:Gist.

No comments:

Post a Comment