t
UKHeliBob:
I tried this
char * const PROGMEM s1[] = {"foo1", "foo2", "foo3"};
char * const PROGMEM s2[] = {"bar11", "bar12", "bar13"};
char * const PROGMEM sequences[] = {s1, s2};
void setup()
{
Serial.begin(115200);
for (int row = 0; row < 3; row++)
{
for (int col = 0; col < 3; col++)
{
Serial.println(strcmp_P( sequences[row] [col], "bar12"));
}
}
}
void loop()
{
}
and got these errors
sketch_apr02a:4: error: cannot convert 'char* const*' to 'char* const' in initialization
char * const PROGMEM sequences[] = {s1, s2};
^
sketch_apr02a:4: error: cannot convert 'char* const*' to 'char* const' in initialization
C:\Users\Bob\AppData\Local\Temp\arduino_modified_sketch_966333\sketch_apr02a.ino: In function 'void setup()':
C:\Users\Bob\AppData\Local\Temp\arduino_modified_sketch_966333\sketch_apr02a.ino:13:51: warning: invalid conversion from 'char' to 'const char*' [-fpermissive]
Serial.println(strcmp_P( sequences[row] [col], "bar12"));
^
In file included from C:\Program Files (x86)\Arduino\1-8-5\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from C:\Users\Bob\AppData\Local\Temp\arduino_build_7461\sketch\sketch_apr02a.ino.cpp:1:
c:\program files (x86)\arduino\1-8-5\hardware\tools\avr\avr\include\avr\pgmspace.h:1258:12: note: initializing argument 1 of 'int strcmp_P(const char*, const char*)'
extern int strcmp_P(const char *, const char *) ATTR_PURE;
^
exit status 1
cannot convert 'char* const*' to 'char* const' in initialization
For the moment I think that I will just be grateful that I have got the pointers im PROGMEM
the strings are the one-dimensional 'leaf' arrays. you should put every single "abcd" to PROGMEM. see the ""Arrays of strings" example on the reference page