<?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[FACES &#x2F;apps&#x2F;game.py doesn&#x27;t run properly (solved)]]></title><description><![CDATA[<p dir="auto">Hi, I just got a FACES set delivered.<br />
When exploring the apps that came with the UIFlow firmware (V1.3.3) I discovered the following:<br />
The script <code>/apps/game.py</code> did not run properly. It showed only the small icon image above the btnB position and a bigger version of this icon in the upper half of the display. However the latter did not change (which it should).<br />
I discovered that the source of the problem was: filenames of the image files that had more than 8 characters.<br />
In the folder <code>/flash/img</code> I changed file names of these three image files to: <code>rock.jpg</code>,  <code>paper.jpg</code> and <code>scissors.jpg</code>.</p>
<p dir="auto">rps_img = (<br />
'img/rock_128.jpg',<br />
'img/paper_128.jpg',<br />
'img/scissors_128.jpg'<br />
)</p>
<p dir="auto">lcd.clear(lcd.WHITE)</p>
<p dir="auto">lcd.image(48, 200,  'img/rock_128.jpg', 2)<br />
lcd.image(143, 200, 'img/paper_128.jpg', 2)<br />
lcd.image(238, 200, 'img/scissors_128.jpg', 2)</p>
<p dir="auto">This fact did not crash the script but it worked only partially.<br />
I made the following modifications:<br />
a)</p>
<p dir="auto">rps_img = (<br />
'img/rock.jpg',<br />
'img/paper.jpg',<br />
'img/scissors.jpg'<br />
)</p>
<p dir="auto">b) since there was already defined <code>rps_img</code>, I used this in the following commands:</p>
<p dir="auto">lcd.image(48, 200, rps_img[0], 2)<br />
lcd.image(143, 200, rps_img[1], 2)<br />
lcd.image(238, 200, rps_img[2], 2)</p>
<p dir="auto">Another problem occurred after I flashed the device with the latest UIFlow firmware (V1.9.4) using M5Burner.<br />
Now the <code>script /apps/game.py</code> crashed because the function  <code>machine.random()</code> does not exist anymore.<br />
The command: <code>rand = machine.random(2)</code> I replaced by:<br />
<code>from random import randint</code><br />
<code>rand = randint(0,2)</code></p>
<p dir="auto">Now the script ran again OK.</p>
]]></description><link>https://community.m5stack.com/topic/4164/faces-apps-game-py-doesn-t-run-properly-solved</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 23:22:39 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4164.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Mar 2022 01:45:11 GMT</pubDate><ttl>60</ttl></channel></rss>