Question

I tried making an array double data[640][14], but the compiler says that the array size is too big. Can anyone tell me what is the maximum size I can use, and how can I work around this problem?

Was it helpful?

Solution

An Arduino Uno has an Atmel 328p MCU. It only has 2048 Bytes of memory. Considering a double takes 8 bytes (64bits) on its own. 640 * 14 * 8 = 71680 bytes.

Does the data you are storing need to be doubles? If you are working with doubles, Arduino is probably very underpowered for what you are trying to do. What is the use case of this array? Even as the smallest data type, it would still be 8960 bytes. If you are storing all Boolean values (1 or 0), then you could store them as individual bits and only take up 1120 bytes.

A little data on what you are trying to do can get you a better answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top