<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Saving and reusing variables?]]></title><description><![CDATA[<p dir="auto">Hi, i've seen the new block in the beta (EEPROM) and I was wondering how can I save the data of the variables so I can use it after rebooting the M5.<br />
Example: the score of a game, save it so the next time you turn off and on the device the score is still there</p>
]]></description><link>https://community.m5stack.com/topic/2249/saving-and-reusing-variables</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:21:42 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2249.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Aug 2020 11:51:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Saving and reusing variables? on Sat, 29 Aug 2020 21:14:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/world101" aria-label="Profile: world101">@<bdi>world101</bdi></a> thank you a lot!!!</p>
]]></description><link>https://community.m5stack.com/post/9876</link><guid isPermaLink="true">https://community.m5stack.com/post/9876</guid><dc:creator><![CDATA[ManuXD32]]></dc:creator><pubDate>Sat, 29 Aug 2020 21:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to Saving and reusing variables? on Sat, 29 Aug 2020 16:48:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: gaviota">@<bdi>gaviota</bdi></a> said in <a href="/post/9874">Saving and reusing variables?</a>:</p>
<blockquote>
<p dir="auto">How many write operations are maximal at the EPROM possible?</p>
</blockquote>
<p dir="auto">I was wondering the same thing. <a href="https://www.arduino.cc/en/Reference/EEPROMWrite" target="_blank" rel="noopener noreferrer nofollow ugc">This source</a> and in more detail <a href="http://www.mosaic-industries.com/embedded-systems/sbc-single-board-computers/freescale-hcs12-9s12-c-language/instrument-control/eeprom-lifetime-reliability-wear-leveling" target="_blank" rel="noopener noreferrer nofollow ugc">this source</a> say the <em>typical</em> is 100,000 write/erase cycles.</p>
<p dir="auto">I'm also wondering which address location uiFlow uses to store the key/value data to EEPROM. <a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> or <a class="plugin-mentions-user plugin-mentions-a" href="/user/lukasmaximus" aria-label="Profile: lukasmaximus">@<bdi>lukasmaximus</bdi></a> do you know?</p>
]]></description><link>https://community.m5stack.com/post/9875</link><guid isPermaLink="true">https://community.m5stack.com/post/9875</guid><dc:creator><![CDATA[world101]]></dc:creator><pubDate>Sat, 29 Aug 2020 16:48:12 GMT</pubDate></item><item><title><![CDATA[Reply to Saving and reusing variables? on Sat, 29 Aug 2020 15:52:09 GMT]]></title><description><![CDATA[<p dir="auto">How many write operations are maximal at the EPROM possible?</p>
]]></description><link>https://community.m5stack.com/post/9874</link><guid isPermaLink="true">https://community.m5stack.com/post/9874</guid><dc:creator><![CDATA[Gaviota]]></dc:creator><pubDate>Sat, 29 Aug 2020 15:52:09 GMT</pubDate></item><item><title><![CDATA[Reply to Saving and reusing variables? on Sat, 29 Aug 2020 12:55:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/manuxd32" aria-label="Profile: manuxd32">@<bdi>manuxd32</bdi></a>,<br />
For uiFlow, there is an example of saving data as a key/value pair in <a href="https://docs.m5stack.com/#/en/uiflow/advanced?id=eeprom" target="_blank" rel="noopener noreferrer nofollow ugc">M5 Docs</a>.</p>
<p dir="auto">I also created a simple example like this...<br />
<img src="/assets/uploads/files/1598705692672-screen-shot-2020-08-29-at-8.52.51-am-resized.png" alt="0_1598705685410_Screen Shot 2020-08-29 at 8.52.51 AM.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/9873</link><guid isPermaLink="true">https://community.m5stack.com/post/9873</guid><dc:creator><![CDATA[world101]]></dc:creator><pubDate>Sat, 29 Aug 2020 12:55:32 GMT</pubDate></item><item><title><![CDATA[Reply to Saving and reusing variables? on Fri, 28 Aug 2020 18:41:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vkichline" aria-label="Profile: vkichline">@<bdi>vkichline</bdi></a> thank youuuu</p>
]]></description><link>https://community.m5stack.com/post/9869</link><guid isPermaLink="true">https://community.m5stack.com/post/9869</guid><dc:creator><![CDATA[ManuXD32]]></dc:creator><pubDate>Fri, 28 Aug 2020 18:41:04 GMT</pubDate></item><item><title><![CDATA[Reply to Saving and reusing variables? on Fri, 28 Aug 2020 17:45:12 GMT]]></title><description><![CDATA[<p dir="auto">Are you talking about NVS (Non Volatile Storage?)<br />
M5ez uses it for its preferences. Here is a file that reads and writes them in C: <a href="https://github.com/vkichline/M5ezSettingsStorage/blob/master/m5ez_prefs_storage.cpp" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vkichline/M5ezSettingsStorage/blob/master/m5ez_prefs_storage.cpp</a></p>
<p dir="auto">Basically, just include preferences.h, call prefs.begin with false for read/write, then use the accessors from preferences.h and finish with prefs.end().</p>
]]></description><link>https://community.m5stack.com/post/9867</link><guid isPermaLink="true">https://community.m5stack.com/post/9867</guid><dc:creator><![CDATA[vkichline]]></dc:creator><pubDate>Fri, 28 Aug 2020 17:45:12 GMT</pubDate></item></channel></rss>