Given:
const char* PROGMEM names[] = {"Foo","Bar"};
Serial.print(names[0]);
I get garbage output. Is there some function that will print the string from PROGMEM? E.G.:
Serial.print(<function name>(names[0]);
Glorfindel
5781 gold badge7 silver badges18 bronze badges
asked Feb 5, 2019 at 16:12
2 Answers 2
Among many others, check out pgmspace.h utilities at AVR-libc
const char PROGMEM b0 = pgm_read_dword(&(names[0]));
Serial.print(b0);
-
2
default
pgm_read_***_near