Go Down

Topic: Declaration of progmem constant string (Read 218 times) previous topic - next topic

anv


I am trying to declare a progmem string just like in the documentation (http://arduino.cc/es/Reference/PROGMEM)

I wrote a little program like this:

Code: [Select]
prog_uchar signMessage[] PROGMEM  = {"I AM PREDATOR,  UNSEEN COMBATANT. CREATED BY THE UNITED STATES DEPART"};

void setup(){
}
void loop(){
}


And when I try to compile, I receive this error:

sketch_feb08b.ino:2:26: error: variable 'signMessage' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

┬┐Any ideas on what is the problem?

(I'm using Arduino 1.0.3 under linux).

PaulS

Quote
And when I try to compile, I receive this error:

So, why don't you add the const qualifier to the declaration and see what happens?

Go Up