You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Language/Variables/Utilities/PROGMEM.adoc
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Store data in flash (program) memory instead of SRAM. There's a description of t
21
21
22
22
The `PROGMEM` keyword is a variable modifier, it should be used only with the datatypes defined in pgmspace.h. It tells the compiler "put this information into flash memory", instead of into SRAM, where it would normally go.
23
23
24
-
PROGMEM is part of the link:http://www.nongnu.org/avr-libc/user-manual/group\__avr__pgmspace.html[pgmspace.h] library. It is included automatically in modern versions of the IDE. However, if you are using an IDE version below 1.0 (2011), you'll first need to include the library at the top your sketch, like this:
24
+
PROGMEM is part of the link:http://www.nongnu.org/avr-libc/user-manual/group\__avr__pgmspace.html[pgmspace.h] library. It is included automatically in modern versions of the IDE. However, if you are using an IDE version below 1.0 (2011), you'll first need to include the library at the top of your sketch, like this:
25
25
26
26
`#include <avr/pgmspace.h>`
27
27
While `PROGMEM` could be used on a single variable, it is really only worth the fuss if you have a larger block of data that needs to be stored, which is usually easiest in an array, (or another C++ data structure beyond our present discussion).
@@ -101,7 +101,7 @@ void loop() {
101
101
----
102
102
*Arrays of strings*
103
103
104
-
It is often convenient when working with large amounts of text, such as a project with an LCD display, to setup an array of strings. Because strings themselves are arrays, this is in actually an example of a two-dimensional array.
104
+
It is often convenient when working with large amounts of text, such as a project with an LCD, to setup an array of strings. Because strings themselves are arrays, this is actually an example of a two-dimensional array.
105
105
106
106
These tend to be large structures so putting them into program memory is often desirable. The code below illustrates the idea.
107
107
@@ -146,7 +146,7 @@ void setup() {
146
146
void loop() {
147
147
/* Using the string table in program memory requires the use of special functions to retrieve the data.
148
148
The strcpy_P function copies a string from program space to a string in RAM ("buffer").
149
-
Make sure your receiving string in RAM is large enough to hold whatever
149
+
Make sure your receiving string in RAM is large enough to hold whatever
0 commit comments