Store multi-dimensional array to PROGMEM

Hi,

I make program to Arduino Mega2560 and I have large button array to TFT display. I try many opinions to put data to PROGMEM. I make library but no succes to add array to PROGMEM.

I have struct

typedef struct { int startX; int startY; int endX; int endY; int numOfBtn.Buttons; char *text; char *color; char *textColor; char *function; char *font; } TFTButtons;

and I use

TFTButtons Buttons[9][14];

I need put data to struct like this way, because I need know what I make and modify

Buttons[0][0].numOfButtons = 2; Buttons[0][0].startX = 219; Buttons[0][0].startY = 210; Buttons[0][0].endX = 319; Buttons[0][0].endY = 236; Buttons[0][0].text = "MENU"; Buttons[0][0].color = "novus"; Buttons[0][0].textColor = "white"; Buttons[0][0].function = "push"; Buttons[0][0].font = "big"; Buttons[0][1].startX = 1; Buttons[0][1].startY = 210; Buttons[0][1].endX = 101; Buttons[0][1].endY = 236; Buttons[0][1].text = "Mode"; Buttons[0][1].color = "novus"; Buttons[0][1].textColor = "white"; Buttons[0][1].function = "push"; Buttons[0][1].font = "big"; Buttons[1][0].numOfButtons = 9; Buttons[1][0].startX = 219; Buttons[1][0].startY = 210; Buttons[1][0].endX = 319; Buttons[1][0].endY = 236; Buttons[1][0].text = "BACK"; Buttons[1][0].color = "novus"; Buttons[1][0].textColor = "white"; Buttons[1][0].function = "push"; Buttons[1][0].font = "big"; Buttons[1][1].startX = 10; Buttons[1][1].startY = 20; Buttons[1][1].endX = 150; Buttons[1][1].endY = 50; Buttons[1][1].text = "KNX"; Buttons[1][1].color = "novus"; Buttons[1][1].textColor = "white"; Buttons[1][1].function = "push"; Buttons[1][1].font = "big"; Buttons[1][2].startX = 10; Buttons[1][2].startY = 60; Buttons[1][2].endX = 150; Buttons[1][2].endY = 90; Buttons[1][2].text = "Blowers"; Buttons[1][2].color = "novus"; Buttons[1][2].textColor = "white"; Buttons[1][2].function = "push"; Buttons[1][2].font = "big"; Buttons[1][3].startX = 10; Buttons[1][3].startY = 100; Buttons[1][3].endX = 150; Buttons[1][3].endY = 130; Buttons[1][3].text = "Time"; Buttons[1][3].color = "novus"; Buttons[1][3].textColor = "white"; Buttons[1][3].function = "push"; Buttons[1][3].font = "big"; .... Buttons[8][0].numOfButtons = 1; Buttons[8][0].startX = 219; Buttons[8][0].startY = 210; Buttons[8][0].endX = 319; Buttons[8][0].endY = 236; Buttons[8][0].text = "BACK"; Buttons[8][0].color = "novus"; Buttons[8][0].textColor = "white"; Buttons[8][0].function = "push"; Buttons[8][0].font = "big";

How I can put this data to PROGMEM? The FLASH memory is full.

Thanks, Pekka

If FLASH is full, then you can't put this in PROGMEM. PROGMEM is FLASH. Will it fit in EEPROM?

I mean this:

Sketsi käyttää 63 574 tavua (25%) ohjelmamuistia. Maksimi on 253 952 tavua. Globaalit muuttujat käyttävät 6 182 tavua (75%) dynaamista muistia, jättäen 2 010 tavua paikallisille muuttujille. Maksimi on 8 192 tavua. Low memory available, stability problems may occur.

I think You now what it's mean in english...

When I add more buttons to Buttons array, global variables use more memory.

Which version of the IDE are you using? Things have changed along the way.

1.6.5