Go Down

Topic: Max number of Strings in a char array (Read 548 times) previous topic - next topic

Elso

Hi there,
I am controlling an external LCD display, I have two char arrays with words, I randomly extrapolate words off each one of them, the concatenate them and visualise them on the display.
I was wondering, how many can I store in the Arduino Mega (which will run without laptop) before having to use external RAM?
Also, as I haven't used such RAM before, could you please advice what is the one I should buy?

Many thanks

Best

Elso

PaulS

Quote
I was wondering, how many can I store in the Arduino Mega (which will run without laptop) before having to use external RAM?

You can't store Strings of any size in a char array. You can store strings. There is a world of difference between the two.

There is no fixed number of strings that can fit in SRAM. There is a fixed limit on the amount of SRAM, but strings (and their length is critical) are only one of the things stored in SRAM.

Elso

Thanks Paul,
ops, yes, indeed I meant strings, not Strings...
:smiley-red:
The length of each string varies from 2 to 10 characters.
Since my arrays of strings won't change after the program runs, I guess I should store them both in the Flash memory through the PROGMEM, am I right?

Best

Elso

PaulS

Quote
I guess I should store them both in the Flash memory through the PROGMEM, am I right?

Yes, you are.


Go Up