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

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

问题描述

我有三个字符数组,而我不希望Arduino的存储那些 SRAM ,所以我想用PROGMEM存储和闪存读取代替。

 的char * firstArr [] = {选项1,选项2,选项3,4选项};
字符* secondArr [] = {测试1,测试2};


解决方案

有一个关于如何做precisely本的 Arduino上网站。 (参见字符串数组下)。

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".)

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

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