Pages: [1]   Go Down
Author Topic: Declaration of progmem constant string  (Read 190 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 2
Posts: 73
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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:
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).
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: [1]   Go Up
Jump to: