Pages: [1]   Go Down
Author Topic: Max number of Strings in a char array  (Read 498 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I guess I should store them both in the Flash memory through the PROGMEM, am I right?
Yes, you are.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks!
Logged

Pages: [1]   Go Up
Jump to: