Pages: [1]   Go Down
Author Topic: Correction to PROGMEM tutorial  (Read 752 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
the PROGMEM tutorial has an error in it (or maybe it's due to a compiler bug.

Basically, this line:
PGM_P PROGMEM string_table[] =

needs to be changed to:
PGM_P string_table[] PROGMEM =

It won't work unless progmem comes after the array variable declaration the same way that the strings are declared in the preceeding lines. This wasted most of a morning before I discovered why it didn't work, so fixing it will prevent someone else from being stuck on the same problem.

Hans

Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I updated the example.
Logged

Pages: [1]   Go Up
Jump to: