Skip to content

Commit 11c5118

Browse files
authored
Update PROGMEM.adoc
The use of pgm_read_word() in the example is wrong and only works on 16 bit systems. We are dealing with a pointer here so the correct function would be pgm_read_ptr().
1 parent 4ca291e commit 11c5118

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Language/Variables/Utilities/PROGMEM.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void loop() {
151151
152152
153153
for (int i = 0; i < 6; i++) {
154-
strcpy_P(buffer, (char *)pgm_read_word(&(string_table[i]))); // Necessary casts and dereferencing, just copy.
154+
strcpy_P(buffer, (char *)pgm_read_ptr(&(string_table[i]))); // Necessary casts and dereferencing, just copy.
155155
Serial.println(buffer);
156156
delay(500);
157157
}

0 commit comments

Comments
 (0)