i have arrays of char in progmem and i need a function to read out a part of that array into a string.
Cpp is not mit “native” language so i have problems with it…
I have writen some code but i get the error “invalid conversion from ‘char’ to ‘const char*’”.
const char* const menu[] PROGMEM = {"Text 1","Text 2","Text 3","Text 4"};
// and other arrays
String output;
String readp(char text)
{
char c;
int k;
int len = strlen_P((char*)text);
for (k = 0; k < len; k++)
{
strcat_P(c, pgm_read_byte_near(text + k));
}
return c;
}
void Setup()
{
output = readp(menu[2]);
}
Could someone help me what i have to change to get it to work?