C - 如何使用 PROGMEM 存储和读取字符数组 [英] C - how to use PROGMEM to store and read char array

查看:34
本文介绍了C - 如何使用 PROGMEM 存储和读取字符数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个字符数组,我不希望 Arduino 将它们存储在 SRAM 中,所以我想要使用 PROGMEM 在 flash 中存储和读取.

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"};

推荐答案

有一个关于如何精确执行此操作的示例 在 Arduino 网站上.(参见字符串数组".)

There's an example on how to do precisely this on the Arduino website. (See under "Arrays of strings".)

这篇关于C - 如何使用 PROGMEM 存储和读取字符数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆