When you want to read a variable of 32-bits, use the pgm_read_dword().
And you have to use the address with '&', like this: &int_table [/glow] ```
*// Tested with Arduino 1.5.8
// avr-libc: <avr/pgmspace.h>: Program Space Utilities
//
void loop()
{
for (int i = 0; i < 6; i++)
{
// unsigned long is 32 bit, use 32-bit 'dword'.
unsigned long x = pgm_read_dword(&long_table[i]);
Serial.println(x);
delay( 500 );
}
} ```* (while I was writing this, Coding Badly already mentioned the dword)
westfw:
Much of the pgmspace stuff is pretty broken on chips with more than 64k of flash
Please be aware that the PROGMEM segment is just 64KB in size.
If your program needs more than 64KB of flash memory constants (i.e. on a MEGA2560), you can just use 64KB of flash memory as PROGMEM.
And all the rest of the flash variables in your program must be accessed in a very special way of programming.
So, for example, if you want to put 100 KB image data or 200KB of sound sample data in a program for Atmega2560, this is possible, but don't try doing it with PROGMEM!