Array maximum size on UNO

Hi,

I'm trying to create a program which will log data. I wanted to set an Arduino to log data for 3 years (1905 days), and log data to it each hour of the day. This would give a double array, mxn, of 45,720 entries.

When I tried to compile my code (snip-it below), it told me that the array was too large. I tried various values below 1905, and when I tried 500, it allowed it. The array I'm interested in has a type int, and all values will be whole and positive.

How do I figure out what the max size of the array I can use is? And why was mine too large? I was planning on using an 8GB microSD card later (but I haven't included it yet).

// Array mxn for logging data
const int day_row_max = 1905; // maximum day count
const int hour_column_max = 24;   // hour interval   
int datalogger[day_row_max][hour_column_max];  //[day number][hour interval]

You need to store the data on the SD as you get it and not store everything in RAM. You have 2K of RAM available for everything.

Just make your array small for now. You'll have plenty of time to test the rest of your code (with a small array) before you get the SD card :wink:

Maximum array size in the AVR architecture is 32kbytes, because of 16bit pointers and ...mumble handwave...
That would be "long myarray[8192];"
Of course, the Uno only has 2k of actual memory, do the practical limit is much smaller.