I want to use large size array's for animating leds.
It works fine when the array is not to large, and not using progmem.
But when I put the same small array (as a test) in progmem, the readings out of the array are completly wrong (serial printed the results for this test).
nothing like those numbers in the array like -22874.
It almost looks like it's ready some random data, sometimes with patern like results.
Ones it was reading a completly diferent array somehow.
The only code I added to put the array into PROGMEM are...
#include <avr/pgmspace.h>
and put PROGMEM in the array code like this...
int lightningbrightnessArray[117] PROGMEM ={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 93, 131, 110, 75, 58, 24, 14, 154, 124, 112, 36, 71, 41, 16, 24, 25, 10, 10, 5, 4, 2, 2, 1, 1, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 34, 30, 46, 25, 23, 10, 7, 5, 4, 4, 3, 1, 1, 0, 28, 11, 6, 3, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
When I remove "PROGMEM" it works fine, but can't get longer array's into ram.
What can be the problem here? Why are the results not the same?