Go Down

Topic: Read big array from header file (Read 1 time) previous topic - next topic

PaulS


gvi70000

const uint16_t name[] = //78*40=3120 items in array
{
   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
   0x0000,0x0022,0x0066,0x00AA,0x00EF,0x0154,0x0176,0x0177,
   0x0177,0x0177,0x0177,0x0178,0x0176,0x0111,0x00CD,0x0088,
   0x0044,0x0022,0x0000,0x0000,0x0000,0x0000,0x0000,0x0020,
   0x0105,0x02CD,0x055A,0x061E,0x065F,0x067F,0x067F,0x067F,
   0x065F,0x04B7,0x0146,0x0000,0x0000,0x0000,0x0000,0x0000,
   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
   0x0021,0x0167,0x0371,0x057A,0x05DD,0x063E,0x067F,0x065F,
   0x061E,0x03B2,0x00A3,0x0000,0x2040,0x58A0,0xA940,0xB960,
   0xC980,0xC980,0xC980,0xC980,0xC180,0x8900,0x0000,0x0000,
   0x0000,0x0000,0x0000,0x0000,0x0000,0x0022,0x0089,0x0110,
   0x0155,0x0155,0x0111,0x00CC,0x00AA,0x0088,0x0087,0x0088,

Senso

You have an 2K RAM, putting more than say 1,7Kb of data in the ram will likely kill your arduino programm because the stack will be corrupted by data and it will just have an erratic behaviour, as said, google for avr progmem and learn how to use it, that will move the data from the ram to the flash memory.

gvi70000

Got it working
my stupid assumption was that using PROGMEM the data will be stored in sram
sorry for your time wasted with me


Go Up