I want to convert const char array in PROGMEM to String. How do I do this?
const char charArray[] PROGMEM = "Some text";
you can use a cast to __FlashStringHelper
to invoke the right constructor of the String class. It is the constructor which copies the char array from PROGMEM. __FlashStringHelper
is intended as return type for the F() macro.
const char charArray[] PROGMEM = "Some text";
void setup() {
Serial.begin(115200);
String s((const __FlashStringHelper*) charArray);
Serial.println(s);
}
void loop() {
}
that is not work
.... that statement provides no useful information .... describing the actual error would help