<?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 digital input interrupt]]></title><description><![CDATA[<p dir="auto">In UIFlow is it possible to use an interrupt on an input? when I get a sub millisecond low signal on an input I would like to run some code.</p>
]]></description><link>https://community.m5stack.com/topic/2147/uiflow-digital-input-interrupt</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 10:39:46 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2147.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Jul 2020 04:18:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UIFlow digital input interrupt on Thu, 31 Jul 2025 04:52:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bozho" aria-label="Profile: bozho">@<bdi>bozho</bdi></a> did you have any luck. It is clear on Uiflow1 how to detect rising inputs but I don't see this on Uiflow2...or is this is actually what is meant by the 'button press' block on the 'pin button' hardware module?</p>
]]></description><link>https://community.m5stack.com/post/29670</link><guid isPermaLink="true">https://community.m5stack.com/post/29670</guid><dc:creator><![CDATA[adamm5]]></dc:creator><pubDate>Thu, 31 Jul 2025 04:52:19 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Thu, 17 Jul 2025 09:08:37 GMT]]></title><description><![CDATA[<p dir="auto">A digital input interrupt in UIFlow is used to respond instantly to changes in the state of a pin, such as the pressing or releasing of a button. Instead of constantly checking the pin, you set an interrupt on a chosen GPIO with rising, falling, or changing detection. The callback function is triggered by this event, making your program more efficient and responsive to real-time input without using excessive processing power.</p>
]]></description><link>https://community.m5stack.com/post/29527</link><guid isPermaLink="true">https://community.m5stack.com/post/29527</guid><dc:creator><![CDATA[peolsolutions]]></dc:creator><pubDate>Thu, 17 Jul 2025 09:08:37 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Thu, 10 Jul 2025 14:24:31 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: Gaviota">@<bdi>Gaviota</bdi></a>.<br />
Currently I'm still learning to use UI Flow IDE and I want to crate the same thing- counting pulses and showing them on the screen. Can you send me your Blocky?<br />
Thanks,<br />
Bozho</p>
]]></description><link>https://community.m5stack.com/post/29452</link><guid isPermaLink="true">https://community.m5stack.com/post/29452</guid><dc:creator><![CDATA[bozho]]></dc:creator><pubDate>Thu, 10 Jul 2025 14:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Sat, 19 Jun 2021 12:27:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lyledodge" aria-label="Profile: lyledodge">@<bdi>lyledodge</bdi></a> I can’t see attached file. Is there any or it problem with my iPhone?</p>
]]></description><link>https://community.m5stack.com/post/14146</link><guid isPermaLink="true">https://community.m5stack.com/post/14146</guid><dc:creator><![CDATA[Doswiadczalnik]]></dc:creator><pubDate>Sat, 19 Jun 2021 12:27:57 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Fri, 04 Jun 2021 22:54:58 GMT]]></title><description><![CDATA[<p dir="auto">I've created a custom module to avoid the need to use the "Execute" block.  It basically gives you a way to set the pin number, trigger, and callback for the IRQ.  You will still create your own function using Blockly.</p>
<ol>
<li>Create a Variable: example "counter"</li>
<li>Create a Function:
<ol>
<li>Name it what you like, example: "count_pulses"</li>
<li>Add single step from Variables: change counter by 1</li>
</ol>
</li>
<li>Init PWM0 with your desired pin, freq, and duty</li>
<li>Load the attached file under Custom | Open *.m5b file</li>
<li>Drag "PIN_IRQ" from Custom onto your workspace
<ol>
<li>Set the pin number (just an integer, 0 for example)</li>
<li>Set your trigger "machine.Pin.IRQ_RISING"</li>
<li>Set the handler to your function from step 2 above "count_pulses"</li>
</ol>
</li>
<li>Add a label if you want and set the loop event to update a label with the current counter value</li>
<li>It sounds more complicated than it actually is, check the screenshot</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1622847040651-pwm_irq_demonstration.png" alt="0_1622847040214_PWM_IRQ_Demonstration.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Your resulting code should look vaguely like this:</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import machine

setScreenColor(0x222222)

counter = None

label0 = M5TextBox(146, 187, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)

from numbers import Number

def count_pulses():
  global counter
  counter = (counter if isinstance(counter, Number) else 0) + 1

PWM0 = machine.PWM(26, freq=25000, duty=50, timer=0)
pin0.irq(trigger=machine.Pin.IRQ_RISING, handler=count_pulses)
while True:
  label0.setText(str(counter))
  wait_ms(2)
</code></pre>
<p dir="auto">Have fun storming the castle!</p>
]]></description><link>https://community.m5stack.com/post/14001</link><guid isPermaLink="true">https://community.m5stack.com/post/14001</guid><dc:creator><![CDATA[LyleDodge]]></dc:creator><pubDate>Fri, 04 Jun 2021 22:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Wed, 24 Feb 2021 01:39:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: Gaviota">@<bdi>Gaviota</bdi></a> post was helpful to me. Thanks.<br />
Below is an example of a N/O button interrupt, connected between G26 and GND.<br />
Counter increments multiple times per button push.<br />
This shows that software debounce could be necessary in many cases.<br />
Cheers - BillT<br />
<img src="/assets/uploads/files/1614130219009-interrupt-resized.png" alt="0_1614130213067_interrupt.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/12636</link><guid isPermaLink="true">https://community.m5stack.com/post/12636</guid><dc:creator><![CDATA[BT99]]></dc:creator><pubDate>Wed, 24 Feb 2021 01:39:16 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Fri, 25 Sep 2020 20:06:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: Gaviota">@<bdi>Gaviota</bdi></a><br />
hello Gaviota,<br />
i tried to run your code, but i always get an error.<br />
Would you be so kind to post the full program so i can find my mistake.</p>
<p dir="auto">Thank yo in advance,<br />
Schubi</p>
]]></description><link>https://community.m5stack.com/post/10327</link><guid isPermaLink="true">https://community.m5stack.com/post/10327</guid><dc:creator><![CDATA[Schubi]]></dc:creator><pubDate>Fri, 25 Sep 2020 20:06:33 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Fri, 25 Sep 2020 11:13:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: Gaviota">@<bdi>Gaviota</bdi></a><br />
Hello Gaviota,<br />
thank you for sharing this information.</p>
<p dir="auto">I tried to implement it, but i get an error.<br />
Would you be so kind to post the whole program?</p>
<p dir="auto">Thank you in advance,</p>
<p dir="auto">Schubi</p>
]]></description><link>https://community.m5stack.com/post/10324</link><guid isPermaLink="true">https://community.m5stack.com/post/10324</guid><dc:creator><![CDATA[Schubi]]></dc:creator><pubDate>Fri, 25 Sep 2020 11:13:00 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Tue, 22 Sep 2020 15:39:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gaviota" aria-label="Profile: Gaviota">@<bdi>Gaviota</bdi></a><br />
hello and thank you for your information.<br />
Would you be so kind to post the full code?<br />
It doesn't work for me - i always get a syntax error.</p>
<p dir="auto">Thanks in advance,</p>
<p dir="auto">Schubi</p>
]]></description><link>https://community.m5stack.com/post/10302</link><guid isPermaLink="true">https://community.m5stack.com/post/10302</guid><dc:creator><![CDATA[Schubi]]></dc:creator><pubDate>Tue, 22 Sep 2020 15:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Sun, 26 Jul 2020 15:48:59 GMT]]></title><description><![CDATA[<p dir="auto">Hello,<br />
try an execute block, look at my code below.</p>
<p dir="auto">First i defined the two variables "is_running" and "counter".<br />
In UIFlow i defined pin0 with GPIO26 as input with pull down resistor.!<br />
Then i defined the event_interrupt(pin) - procedure. I use it for counting impulses at the GPIO26, therefore it is necessary to declare the variables as globals.</p>
<p dir="auto">Every second i read in the main loop the value of the counter variable and reset the is_running variable.</p>
<p dir="auto">def event_interrupt(pin):<br />
global is_running, counter<br />
is_running = True<br />
counter += 1</p>
<p dir="auto">pin0.irq(trigger=machine.Pin.IRQ_RISING, handler=event_interrupt)</p>
<p dir="auto"><img src="/assets/uploads/files/1595778122129-interrupt-resized.jpg" alt="0_1595778123207_interrupt.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/9446</link><guid isPermaLink="true">https://community.m5stack.com/post/9446</guid><dc:creator><![CDATA[Gaviota]]></dc:creator><pubDate>Sun, 26 Jul 2020 15:48:59 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Fri, 24 Jul 2020 23:53:27 GMT]]></title><description><![CDATA[<p dir="auto">50hz triac phase control with zero crossing timing synchronization. 100micro second timing tolerance or better. I ended up porting to Arduino/C++, too many limitations with UIFlow for now, python maybe to slow anyway. UIFlow is a good tool for higher level/basic control.</p>
]]></description><link>https://community.m5stack.com/post/9436</link><guid isPermaLink="true">https://community.m5stack.com/post/9436</guid><dc:creator><![CDATA[birdsong]]></dc:creator><pubDate>Fri, 24 Jul 2020 23:53:27 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow digital input interrupt on Thu, 23 Jul 2020 09:08:16 GMT]]></title><description><![CDATA[<p dir="auto">When you say sub millisecond I guess you are not going to use a button to interrupt, if so then how do you intend to interrupt from an input</p>
]]></description><link>https://community.m5stack.com/post/9420</link><guid isPermaLink="true">https://community.m5stack.com/post/9420</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Thu, 23 Jul 2020 09:08:16 GMT</pubDate></item></channel></rss>