<?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[Guidance on running multiple programs]]></title><description><![CDATA[<p dir="auto">Hi all, I am still trying to figure out a lot about UIFLOW.  I have gotten two independent programs to function using UIFLOW. One is to control my speakers and one as a clock and weather.  My goal is to have a touch that allows me to switch between the "functions"/"screen"</p>
<p dir="auto">I can write it as all one program under UIFLOW, but I would have to rewrite one of the programs by repeating all the code of the second program, since there is no copy and past program.</p>
<p dir="auto">So I am thinking to call it out as a sub-routine.  But how do I call the PROGRAM B from PROGRAM A?  Similarly, using the Download function, the programs gets uploaded to FLASH RAM, can this only function as a startup program of M5Paper or can I call these programs from within another program that is running?</p>
<p dir="auto">Looking for some guidance, hopefully my explanation is understandable...  Thanks all.</p>
]]></description><link>https://community.m5stack.com/topic/3930/guidance-on-running-multiple-programs</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 23:55:31 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3930.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Jan 2022 21:32:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Guidance on running multiple programs on Fri, 21 Jan 2022 02:35:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robalstona" aria-label="Profile: robalstona">@<bdi>robalstona</bdi></a> thank you for the guidance as it saves me a lot of trial and error. Appreciate it.</p>
]]></description><link>https://community.m5stack.com/post/16270</link><guid isPermaLink="true">https://community.m5stack.com/post/16270</guid><dc:creator><![CDATA[joefly]]></dc:creator><pubDate>Fri, 21 Jan 2022 02:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to Guidance on running multiple programs on Mon, 17 Jan 2022 08:39:34 GMT]]></title><description><![CDATA[<p dir="auto">Programs on the device are saved in two files<br />
<strong>program_name.m5b</strong> (used only by uiflow to put the project back into the editor)<br />
<strong>program_name.py</strong> (generated python code based on your project in uiflow). This file is run on the target device.</p>
<p dir="auto">You can use the <strong>import program_name.py</strong> statement in your program in the <strong>execute</strong> block. Then it will be loaded and run.<br />
But this method has its drawbacks, because the initialization instructions at the beginning of the program will be reloaded. You have to be careful what variable names you use, so that you don't overwrite the variable values with new ones from the imported file.<br />
The import statement imports the code the first time and runs it, subsequent imports of the same file just load it into memory without running it (you can find a solution to this problem on google.<br />
Ewentually you could edit your python code before upload to device with this way to solve above problem</p>
<pre><code>def main():
  # place whole generated python
  # file in this function with
  # proper intend

main()
</code></pre>
]]></description><link>https://community.m5stack.com/post/16237</link><guid isPermaLink="true">https://community.m5stack.com/post/16237</guid><dc:creator><![CDATA[robalstona]]></dc:creator><pubDate>Mon, 17 Jan 2022 08:39:34 GMT</pubDate></item><item><title><![CDATA[Reply to Guidance on running multiple programs on Sun, 16 Jan 2022 16:41:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> Thanks for responding.  I am familiar with that function.  What I meant is if I have to separate programs.  Is there away to call up the other program already residing in the flash.  Or another words switch between two separate programs within flash memory, and to call from within one program to the other. If so how do I program it to do so.</p>
<p dir="auto">Sorry if I was not clear.</p>
]]></description><link>https://community.m5stack.com/post/16228</link><guid isPermaLink="true">https://community.m5stack.com/post/16228</guid><dc:creator><![CDATA[joefly]]></dc:creator><pubDate>Sun, 16 Jan 2022 16:41:53 GMT</pubDate></item><item><title><![CDATA[Reply to Guidance on running multiple programs on Sun, 16 Jan 2022 08:43:18 GMT]]></title><description><![CDATA[<p dir="auto">You create function loops for each function and then in the main loop you add an action that triggers the matching function call block which triggers the separate function.<br />
<img src="/assets/uploads/files/1642322585863-screenshot-2022-01-16-at-08.42.54.png" alt="0_1642322584594_Screenshot 2022-01-16 at 08.42.54.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/16214</link><guid isPermaLink="true">https://community.m5stack.com/post/16214</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 16 Jan 2022 08:43:18 GMT</pubDate></item></channel></rss>