Hello !
I'm new to Arduino and i've tried the Code attached.
The result was:
freeMemory()=1635
97
I was expecting the result of my array[0] which is 1 but not 97 ?
At my first attempt i was using double to store in Progmem. I've read about "Floating point numbers in program memory do not appear to be supported." in the Arduino Reference. So i made this simple test with byte. But obviously there is a lack of understanding. When i exchange the line "byte PROGMEM list[100] " with "prog_uchar PROGMEM list[100]" it doesn't change the result.
I'd be happy to get any hint on this issue.
Arduino IDE 1.0.5-r2 / ATmega 368
#include <MemoryFree.h>
#include <avr/pgmspace.h>
void setup(void) {
Serial.begin(9600);
}
void loop ()
{
delay(2000);
Serial.print(F("freeMemory()="));
Serial.println(freeMemory());
byte PROGMEM list[100] = {
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0
};
Serial.println(pgm_read_byte (&list[0]));
}