私は3つの文字配列を持っていますが、ArduinoにそれらをSRAMに格納したくないので、代わりにflashにPROGMEMを格納して読み込みます。C - PROGMEMを使用して文字配列を格納および読み込む方法
char *firstArr[]={"option 1","option 2","option 3","option 4"};
char *secondArr[]={"test 1","test 2"};
私は3つの文字配列を持っていますが、ArduinoにそれらをSRAMに格納したくないので、代わりにflashにPROGMEMを格納して読み込みます。C - PROGMEMを使用して文字配列を格納および読み込む方法
char *firstArr[]={"option 1","option 2","option 3","option 4"};
char *secondArr[]={"test 1","test 2"};
正確にこれを行う方法の例があります。on the Arduino websiteです。 (「文字列の配列」を参照してください。)
はい、Arduino Webサイトの例があります。しかし、私はあなたにcompiler bug in GCCと次の回避策を知らせたいと思っています:
/**
* 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")))