Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [progmem]

PROGMEM is a keyword used when declaring a variable that keeps the data in flash instead of copying it into SRAM. It is part of the `pgmspace.h` library. Use this tag for discussions about using this attribute.

3
votes
2answers
8k views

Using PROGMEM to store array of structs

I am hitting the limits of my arduino's SRAM and found that SRAM usage can be reduced by storing static stuff in flash memory instead of SRAM. My project can (optionally) be built with an included ...
6
votes
1answer
2k views

What are the benfits of global variables over static class members?

On an embedded system we use global variables often to keep dynamic memory consumption on heap and stack low. But global variables are also considered bad programming practice if they aren't used in a ...
2
votes
1answer
764 views

Better method for PROGMEM data access with multiple indirection?

-edit- This is a simplified recreation of personal learning project I have ongoing. My issue is in accessing data in flash, the path to which includes multiple layers of indirection. When the data ...
1
vote
3answers
3k views

Storing array in PROGMEM

I have an array of a lot of numbers (1 and 0) but i can't store them since arduino does not have enough space. How can i save an array of example 00110 in PROGMEM, then read from PROGMEM and set x to ...
0
votes
1answer
274 views

Reading a 10-byte buffer out of a PROGMEM string stored in a string table

I'm storing a large snippet of text in three separate PROGMEM char arrays: const char script1[] PROGMEM = "...."; const char script2[] PROGMEM = "...."; const char script3[] PROGMEM = "...."; The ...