1

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]);
2

2 Answers 2

2

Among many others, check out pgmspace.h utilities at AVR-libc

0
const char PROGMEM b0 = pgm_read_dword(&(names[0]));
Serial.print(b0);
1
  • 2
    PROGMEM does nothing here
    – Juraj
    May 7, 2023 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.