I have three char arrays, and I don't want Arduino store those in SRAM, so I want to use PROGMEM to store and read in flash, instead.
char *firstArr[]={"option 1","option 2","option 3","option 4"};
char *secondArr[]={"test 1","test 2"};
There's an example on how to do precisely this on the Arduino website. (See under "Arrays of strings".)
Yes, there is an example on the Arduino web site. But I want to make you aware of a compiler bug in GCC, and the following work-around:
/**
* Alternative to PROGMEM storage class
*
* Same effect as PROGMEM storage class, but avoiding erroneous warning by
* GCC.
*
* \see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
*/
#define PROGMEM_ __attribute__((section(".progmem.data")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With