<?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[Lesson 15.1. UIFlow it&#x27;s easy]]></title><description><![CDATA[<h3>The purpose of this lesson</h3>
<p dir="auto">Hi! Today we finally get to know in detail the elements of UIFlow and understand the things that previously seemed mysterious (figure 1).</p>
<p dir="auto"><img src="https://pp.userapi.com/c846124/v846124066/1899a8/YF_eHLo28Xw.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 1</p>
<p dir="auto">This lesson will teach you how to understand the interface of the UIFlow development environment and understand the basic principles of working with blocks.</p>
<h3>Short help</h3>
<ul>
<li>Purpose: development environment for m5stack family of devices in Blockly and MicroPython languages</li>
<li>Scope: education</li>
<li>Connection interface: Wi-Fi (Internet)</li>
<li>Compatibility: device family M5STACK</li>
</ul>
<h3>Brief overview</h3>
<p dir="auto">In order to start please follow the link <a href="http://flow.m5stack.com" target="_blank" rel="noopener noreferrer nofollow ugc">http://flow.m5stack.com</a> (detailed connection procedure given in lesson 15). Let's look at section A in figure 2-these are UI elements. You can drag and drop them to the virtual device display and then access them using the links in the UI tab. Good! Now let's look at section B - a library of Units-modules, their methods and properties are hidden in the tab under the same name.</p>
<p dir="auto"><img src="https://pp.userapi.com/c844521/v844521094/194fe2/ONiGY1vcH_c.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 2</p>
<p dir="auto">Section C contains Loop loop and built-in button event handlers.<br />
Section D contains a switch between Blockly or Python programming languages. Section E contains the main menu. You can access the forum with the first button; read the documentation with the second button; with the third button, you can select sample programs; with the fourth and fifth buttons, you can undo or redo the action; with the sixth button, you can open the resource Manager (for example, to load pictures into the device memory); by clicking on the seventh button you will load the code into the temporary memory of the device and run it (the code will be deleted after the device reboot); with the last button you can open the continuation of the menu. In this section E is finished. Let's look at the last one with the first button (at the top) to place the Blockly code in the center of the workspace; with the second and third buttons you can zoom; in order to delete a block - just drag it to the fourth button (the image of the basket) and the block will be permanently deleted.</p>
<h2>Let's start!</h2>
<h3>Blockly (<a href="http://flow.m5stack.com" target="_blank" rel="noopener noreferrer nofollow ugc">UI Flow</a>)</h3>
<p dir="auto">The most difficult, in my opinion, is to understand how to work with variables. Therefore, I will try to explain this in as much detail as possible in this lesson. All other elements of the language Blockly easy to use because of the fact that the names speak of their direct purpose and the extra words here will not be useful.</p>
<p dir="auto">So let's get started! To create a variable, click the <strong>Variables</strong> tab (1) (figure 3) in the blocks menu, then click the <strong>Create variable button...</strong> (2).</p>
<p dir="auto"><img src="https://pp.userapi.com/c847018/v847018850/18d1eb/h3yg5KQ5mAQ.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 3</p>
<p dir="auto">Now a window will appear asking you to enter the name of the new variable. Enter a name (1) (figure 3.1), then click OK (2).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320234/a566b/Nh6OqJYtblw.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 3.1</p>
<p dir="auto">Great! The variable is now created (figure 3.2). You can now use the <strong>set</strong> and <strong>change</strong> methods to change the values of all created variables.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320234/a5675/I7KBlGLy1Lw.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 3.2</p>
<p dir="auto">If you want to use a variable you drag it with the mouse to the workspace (figure 3.3). You can replace a variable in the block with another one created earlier, as well as rename and delete it.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320234/a5696/3QAJ3zUvUMk.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 3.3</p>
<p dir="auto">The most "difficult" was over. Now you know how to work with variables in Blockly language.</p>
<p dir="auto">Now let's move on to the next tab <strong>Math</strong>. This tab contains mathematical methods and constants (figure 4).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320096/a4685/KQPwfhSm0IM.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 4</p>
<p dir="auto">Pay attention to the first (top) block - it is designed to store numeric values (even integer, even fractional). The second block allows you to perform basic mathematical operations (addition, subtraction, multiplication and division). The third block contains mathematical constants (PI, e, etc.). The fourth block allows you to get the remainder of the division. The fifth block allows you to define the type of number (even, odd, integer or fractional, positive or negative, etc.). All the other blocks, I will not describe, I think You are so clear what they are doing, judging by their names.</p>
<p dir="auto">Now let's go to the tab called <strong>Loops</strong> (figure 5). Here there is all sorts of set of cycles. The first (top) loop executes the code inside the specified number of times (for example, 10). The second loop executes the code until a condition is met. The third will iterate through the list and put the i-th element in the variable i. The fourth one is like a classic for loop. the Fifth block allows you to exit the for loop forcibly.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320096/a46d4/HquBGQBk8kA.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 5</p>
<p dir="auto">Go to the next tab <strong>Logic</strong>. It is not difficult to guess that this tab contains elements related to logical operations (figure 6). The first block (above) is a condition without exception. The second-condition with the exception. The third constant is True or False. Fourth-conditions (&lt;, &lt;=, &gt;, &gt;= and others). Fifth-denial of (NOT), like <strong>!</strong> In the sixth language, the nonexistent NULL value. Seventh-logical operators. The eighth block compares the condition and returns the corresponding value from the if true or if false block.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a2331/HuEnWPwk3_E.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 6</p>
<p dir="auto">Let's look at the <strong>Graphic</strong> tab (figure 7). This tab has a set of methods for displaying text and simple mathematical figures on the display of the device.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a2376/z-aC1WSia7Y.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 7</p>
<p dir="auto">If you want to quickly draw a smiley on your device, the <strong>Emoji</strong> tab will help you perfectly (figure 8).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a2388/i-WdriJtbds.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 8</p>
<p dir="auto">In the future, I hope, in the tab <strong>Timer</strong> (figure 9) there will be additional functions to work with time, but for now You can use the delay block (the time during which the device does nothing).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a239b/KiXizsqCh9Y.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 9</p>
<p dir="auto">It will be difficult to understand the code if it does not consist of functions. Function to create tab <strong>Functions</strong> (figure 10).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a23ae/LiVO1C9IaEE.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 10</p>
<p dir="auto">The first (top) block allows you to create a function named <strong>dosomething</strong> that returns nothing. The second block allows you to create a function that can return a value or variable. If you want to add function arguments, you need to click on the button with the gear image, drag and drop from the left window to the right block <strong>input name</strong> and write the argument name (for example: x, y) (figure 10.1).</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a23bb/gCJMqzIPV_k.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 10.1</p>
<p dir="auto">The third block returns the bound value from the function itself when the condition is met.</p>
<p dir="auto">So, with functions worked out. Let's go to the <strong>Text</strong> tab (figure 11). If you need a string variable, use the first block (above). If you want to convert all letters to upper or lower case, use the second block. If you need to get a letter under a certain sequence number, use the third block. Using the fourth block, you can count the number of occurrences of the first argument in the string. The fifth block allows you to check whether the line is empty. You can find out the length of the string using the sixth block. If you want to display a line, use the seventh block. You can use the eighth block to replace a substring in a string with a new string. With the ninth block you can rewrite the line in reverse. With the help of the tenth block, You can remove the spaces.</p>
<p dir="auto"><img src="https://pp.userapi.com/c851320/v851320311/a23d0/RjD-QabRPRM.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 11</p>
<p dir="auto">If you need to request text input on the device screen, use the eleventh and twelfth blocks. With the thirteenth block, you can cast variables and constants of a different type to the string type.</p>
<p dir="auto">Let's look at the <strong>Lists</strong> tab (figure 12). As you know there is a "data type" in Python.</p>
<p dir="auto"><img src="https://pp.userapi.com/c852236/v852236218/a6f18/atcyYOPPKKE.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 12</p>
<p dir="auto">With the first block (above) you can count the number of items in the list. The second block lets you know if the list is empty. With the third block you can find the number of the item in the list. With the fourth block you can create an empty list. With the help of the fifth block You can create a list with an unlimited number of items added manually (figure 12.1).</p>
<p dir="auto"><img src="https://pp.userapi.com/c852236/v852236218/a6f41/M7kFWxJ5B1A.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 12.1</p>
<p dir="auto">With the sixth block You can get/remove an item under a specific number. With the seventh block You can get a sublist within the given boundaries from the list. With the eighth block you can create a list of the same elements of any length. With the ninth block you can reverse the order of the list. With the tenth block you can set the value of the required list item. With the eleventh block, you can create a list from a string or a string from a list according to a given delimiter. This with the tab for today.</p>
<p dir="auto">Let's move on to the very interesting and latest tab on today's <strong>Remote</strong>.<br />
With this tab you can access Your device from anywhere in the world where there is Internet. It is enough to drag the first block into the code of Your program (above), after downloading the code into the device - the screen will display the QR-code (figure 13.1), if it is scanned using a mobile phone or tablet, a Web page with remote controls (blocks from the second to the last) will open (figure 13.2).</p>
<p dir="auto"><img src="https://pp.userapi.com/c852236/v852236218/a6f22/Y8A1My4LJkg.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 13</p>
<p dir="auto"><img src="https://pp.userapi.com/c852236/v852236493/a86a2/Moeng3xfxJs.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 13.1</p>
<p dir="auto"><img src="https://pp.userapi.com/c847217/v847217871/18a273/4kTHlshdpWI.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Figure 13.2</p>
<p dir="auto">When you access certain elements from the Web page, the corresponding handler functions will be run.</p>
<h3>C &amp; C++ (<a href="https://www.arduino.cc/en/Main/Software" target="_blank" rel="noopener noreferrer nofollow ugc">Arduino IDE</a>)</h3>
<p dir="auto">Example not yet written ^_^</p>
<h3>Downloads</h3>
<p dir="auto">Alas, there is nothing here today :)</p>
]]></description><link>https://community.m5stack.com/topic/568/lesson-15-1-uiflow-it-s-easy</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 18:51:47 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/568.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 Feb 2019 11:55:18 GMT</pubDate><ttl>60</ttl></channel></rss>