<?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 2 bugs?]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I'm very new to UIFlow so this could just be a beginner learning but I'm running into some strange issues with UIFlow.</p>
<ol>
<li>
<p dir="auto">I have the Ext-Encoder working but I'm unable to reliably reset the counter to 0. I'm not sure what all the related blocks do but I've tried a bunch of options using reset encoder rotary value and set rotary value to 0. It seems to occasionally choose a number which isn't 0 to reset to. This presents as the value "resetting" to a consistent random number when hitting a limit switch. Reset number has varied between resets - I can sometimes get the reset value to be 0 if I don't move the encoder during the first few seconds of program time but even that isn't consistent. The sensor is excellent outside of this issue. I'd prefer not to create some hacky workaround or rewrite in Arduino but I'm getting close.</p>
</li>
<li>
<p dir="auto">I couldn't for the life of me get a simple limit switch or button to work. Was messing around with ports, pins, etc and ended up just initializing the pin and using it at the pin level, which then worked without issue. Is there a secret I'm missing or does a simple limit switch not work when using the UIFlow gui as designed? Tried both the limit switch sensor module (U145) and the optical switch (U058) and neither worked.</p>
</li>
</ol>
<p dir="auto">I'm not sure what info to post to help debug this, I could probably create a quick example that illustrates these issues, let me know if that would help.</p>
<p dir="auto">I'm using a core S3 and arc browser.</p>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://community.m5stack.com/topic/7149/uiflow-2-bugs</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 16:23:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7149.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Jan 2025 15:16:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UIFlow 2 bugs? on Thu, 09 Jan 2025 03:33: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> That all makes sense to me.</p>
<p dir="auto">Sorry for the confusion, I'm trying to use either the mechanical limit switch OR the ir photogate as a limit switch. Not trying to use both at the same time. But I was unable to use either module using the corresponding UIFlow module integration. I'll post an example next week which hasn't worked for me so far.</p>
<p dir="auto">Yea, I originally had it in port A but moved it over after confirming there wasn't a negative impact as it's a bit cleaner with both plugs on the same side of the device. If you said there was an electrical difference that could be causing the non-zero reset bug I could try port A again. Any ideas there? Should I be using a different reset / get function? How can I debug this issue better?</p>
<p dir="auto">Seems pretty clear cut when I'm setting the rotary_value to 0 but when I get the rotary value, it's not 0. It resets to the initial value, which is often not 0. Today I recall three reboots which all had different reset values, roughly 636, -1035, -1.</p>
<p dir="auto">-1 was close enough and worked for me, but when I got the other values I just reset the board and basically got it to choose a new "0" value.</p>
]]></description><link>https://community.m5stack.com/post/27820</link><guid isPermaLink="true">https://community.m5stack.com/post/27820</guid><dc:creator><![CDATA[amulder]]></dc:creator><pubDate>Thu, 09 Jan 2025 03:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow 2 bugs? on Wed, 08 Jan 2025 05:59:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amulder" aria-label="Profile: amulder">@<bdi>amulder</bdi></a> You cant use more then 1 Port B device on port B (black port) at a time due to the limit of the hardware (1 pin is hard set to output and one is hard set to input.<br />
To use multiple PortB devices you will need to connect them to a PBHub.<br />
EXT-ENC is a port A device (red port) not a port C (blue port)<br />
Port C is for UART devices normally but if you got it working then fine.</p>
]]></description><link>https://community.m5stack.com/post/27806</link><guid isPermaLink="true">https://community.m5stack.com/post/27806</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 08 Jan 2025 05:59:08 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow 2 bugs? on Wed, 08 Jan 2025 03:12:57 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> Sorry for the delay, I didn't receive a notification.</p>
<p dir="auto">Yes, I'm following the documentation and guidance on ports. Although I'm finding the Ext-Encoder documentation a bit lacking as far as what the functions do / return.</p>
<p dir="auto">I have the Ext-Encoder working in Port C and started with both the limit and optical switch in Port B as they list the GPIO port on the label, but started trying other options when that failed to work. I haven't been able to get the optical switch to work and the only way I got the limit switch to work was using the pin directly.</p>
<p dir="auto">Loving the system, just not sure what I'm doing wrong. I appreciate the help!</p>
<p dir="auto">Here's my current functional (outside of the non-zero reset bug) code. It's really just an encoder (port C), limit switch (port B), ui elements and minor logic.</p>
<pre><code>import os, sys, io
import M5
from M5 import *
from boot_option import *
from hardware import *
from unit import ExtEncoderUnit
import time
import m5utils



label0 = None
label1 = None
charging = None
Title = None
EncoderValue = None
batteryPerc = None
rect0 = None
buttonState = None
image0 = None
i2c0 = None
pin8 = None
Encoder = None


encoderposition = None
ButtonState = None
Located = None
SliderPosition = None
LocTimer = None
displayTimer = None


def setup():
  global label0, label1, charging, Title, EncoderValue, batteryPerc, rect0, buttonState, image0, i2c0, pin8, Encoder, encoderposition, ButtonState, Located, SliderPosition, LocTimer, displayTimer

  M5.begin()
  Widgets.fillScreen(0x222222)
  label0 = Widgets.Label("Value:", 26, 36, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  label1 = Widgets.Label("Limit:", 31, 76, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  charging = Widgets.Circle(252, 34, 4, 0x222222, 0x222222)
  Title = Widgets.Title("Slider", 5, 0xffffff, 0x285c4d, Widgets.FONTS.DejaVu18)
  EncoderValue = Widgets.Label("null", 95, 36, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  batteryPerc = Widgets.Label("100%", 263, 25, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  rect0 = Widgets.Rectangle(0, 138, 20, 100, 0x285c4d, 0x285c4d)
  buttonState = Widgets.Circle(102, 86, 7, 0xffffff, 0x222222)
  image0 = Widgets.Image("res/img/logo_cropped.png", 177, 64, scale_x=.07, scale_y=.07)

  set_boot_option(1)
  i2c0 = I2C(0, scl=Pin(18), sda=Pin(17), freq=100000)
  Encoder = ExtEncoderUnit(i2c0, 0x59)
  time.sleep_ms(500)
  Encoder.reset_rotary_value()
  Encoder.set_rotary_value(0)
  Located = False
  pin8 = Pin(8, mode=Pin.IN)


def loop():
  global label0, label1, charging, Title, EncoderValue, batteryPerc, rect0, buttonState, image0, i2c0, pin8, Encoder, encoderposition, ButtonState, Located, SliderPosition, LocTimer, displayTimer
  M5.update()
  batteryPerc.setText(str((str((Power.getBatteryLevel())) + str('%'))))
  if Power.isCharging():
    charging.setColor(color=0x222222, fill_c=0x33cc00)
  else:
    charging.setColor(color=0x222222, fill_c=0x222222)
  encoderposition = Encoder.get_rotary_value()
  EncoderValue.setText(str(encoderposition))
  ButtonState = (pin8.value() ^ (0x01 &lt;&lt; 0))
  print(encoderposition)
  if ButtonState == 1:
    Located = True
    buttonState.setColor(color=0xFFFFFF, fill_c=0xFFFFFF)
    Encoder.reset_rotary_value()
    Encoder.set_rotary_value(0)
  else:
    buttonState.setColor(color=0xFFFFFF, fill_c=0x222222)
  if Located == False and (time.ticks_diff((time.ticks_ms()), LocTimer)) &gt; 500:
    print('Location unknown')
    LocTimer = time.ticks_ms()
  SliderPosition = min(max(m5utils.remap(encoderposition, 0, 45140, 298, 0), 0), 298)
  if (time.ticks_diff((time.ticks_ms()), displayTimer)) &gt; 15:
    rect0.setCursor(x=(int(SliderPosition)), y=138)
    displayTimer = time.ticks_ms()


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")

</code></pre>
]]></description><link>https://community.m5stack.com/post/27805</link><guid isPermaLink="true">https://community.m5stack.com/post/27805</guid><dc:creator><![CDATA[amulder]]></dc:creator><pubDate>Wed, 08 Jan 2025 03:12:57 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow 2 bugs? on Thu, 02 Jan 2025 19:46:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amulder" aria-label="Profile: amulder">@<bdi>amulder</bdi></a> First question, Are you connecting the units to the correct ports?<br />
The ports are different colours for a reason.<br />
Second question, have you read the documentation and guides on the devices pages of the M5Stack site?<br />
3rd question - can you share your code so that we can see what you are trying to do in UIFlow2?</p>
]]></description><link>https://community.m5stack.com/post/27724</link><guid isPermaLink="true">https://community.m5stack.com/post/27724</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 02 Jan 2025 19:46:37 GMT</pubDate></item></channel></rss>