Go Down

Topic: Declaration of progmem constant string (Read 235 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy