[EDIT: I just found out the solution for the maple mini I use in my project. I just had to write this insteaduint16_t gammaTable[94] [256] __FLASH__ = {...};
then i could just access it as it would be stored in ram... ]
Hey there,
I ve got a problem I could sadly not solve yet...
I want to store a big one dimensional array of uint16_t values and access it dynamically from a function.
This is how i create it
const uint16_t gammaTable[] PROGMEM = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,5,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,18,19,
...
0, 15200, 0,0};
Now the problem is that i cannot not get a specific value dynamically with a variable as array index or so. I can get the variable with a static number as index like this:
Serial.println(pgm_read_word(&gammaTable[93]));
But if i want to access it like this it does not work any more.
void displayFrame() {
for (int i = 0; i < 192; i++) {
uint16_t result = pgm_read_word(&gammaTable[i]);
Serial.println(result);
}
}
I dont know what i can do to read it that way. Does any know it?
best,
Flub