<?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[UIFlow Firmware, ToF unit and ampy]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I like the UIFlow firmware as it's a neat way to test small (less than a screen full of code) samples. I don't care about Blocky in particular.<br />
In short: I like to use MicroPython primarily, but UIFlow secondarily.</p>
<p dir="auto">However I cannot make a simple example work though:</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
tof0 = unit.get(unit.TOF, unit.PORTA)

for count in range(100):
  lcd.print('        ', 0, 0, 0xffffff)
  lcd.print((tof0.distance), 0, 0, 0xffffff)
  wait(1)
</code></pre>
<p dir="auto">This is the output from a very simply Blocky block. Works fine in the UIFlow UI.<br />
But sending the same code via ampy does not work: the tof0.distance is always 0. But the screen clearing works just fine.</p>
<p dir="auto">Is there a way to send Python code to an M5Stack with UIFlow firmware<br />
What's the difference between running UIFlow code and the equivalent Python code?</p>
<p dir="auto">BTW other examples with other external units work fine. So maybe this problem is limited to the ToF unit...</p>
]]></description><link>https://community.m5stack.com/topic/1117/uiflow-firmware-tof-unit-and-ampy</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 09:48:27 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1117.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 Jun 2019 03:50:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UIFlow Firmware, ToF unit and ampy on Tue, 02 Jul 2019 01:40:37 GMT]]></title><description><![CDATA[<p dir="auto">The video <a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> was referring to is here <a href="https://www.youtube.com/watch?v=Y9pOWgsNgKk&amp;t=73s" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=Y9pOWgsNgKk&amp;t=73s</a> hope it helps</p>
]]></description><link>https://community.m5stack.com/post/4744</link><guid isPermaLink="true">https://community.m5stack.com/post/4744</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Tue, 02 Jul 2019 01:40:37 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow Firmware, ToF unit and ampy on Sun, 30 Jun 2019 08:37:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hkubota" aria-label="Profile: hkubota">@<bdi>hkubota</bdi></a> You can send micropython code direct to the M5stack using the download and play buttons.<br />
I have been doing things this way while testing the TOF with the I2C hub.<br />
however, a better way is to use Visual Studio. see the video <a class="plugin-mentions-user plugin-mentions-a" href="/user/lukasmaximus" aria-label="Profile: lukasmaximus">@<bdi>lukasmaximus</bdi></a>  uploaded to the M5Stack youtube channel.</p>
]]></description><link>https://community.m5stack.com/post/4734</link><guid isPermaLink="true">https://community.m5stack.com/post/4734</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 30 Jun 2019 08:37:13 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow Firmware, ToF unit and ampy on Sun, 30 Jun 2019 06:33:40 GMT]]></title><description><![CDATA[<p dir="auto">After testing other units, it seems ToF is the only one broken. All the other ones work just fine when copy&amp;pasting the Python code and running via ampy.</p>
<p dir="auto">Looks like a bug report is in order.</p>
]]></description><link>https://community.m5stack.com/post/4732</link><guid isPermaLink="true">https://community.m5stack.com/post/4732</guid><dc:creator><![CDATA[hkubota]]></dc:creator><pubDate>Sun, 30 Jun 2019 06:33:40 GMT</pubDate></item></channel></rss>