<?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[How to &quot;double click&quot;]]></title><description><![CDATA[<p dir="auto">Hi, all</p>
<p dir="auto">newbi question I know!!!</p>
<p dir="auto">How can I perform a double click event with M5 buttons on arduino envirement?</p>
<p dir="auto">ciao</p>
]]></description><link>https://community.m5stack.com/topic/452/how-to-double-click</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 14:17:03 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/452.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Dec 2018 11:26:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to &quot;double click&quot; on Sat, 29 Dec 2018 20:12:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> Hi, is it compatible with <a href="https://github.com/leonyuhanov/ESP-NOW-TX-RX" target="_blank" rel="noopener noreferrer nofollow ugc">espnow</a>??</p>
<p dir="auto">tnks</p>
]]></description><link>https://community.m5stack.com/post/2252</link><guid isPermaLink="true">https://community.m5stack.com/post/2252</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sat, 29 Dec 2018 20:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to &quot;double click&quot; on Sat, 29 Dec 2018 07:15:21 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/ropg/M5ez" target="_blank" rel="noopener noreferrer nofollow ugc">M5ez</a> is a complete and very easy to use programming environment that offers many other nice things. Among them, you can very easily define what happens with short press, long press as well as combinations of two buttons.</p>
]]></description><link>https://community.m5stack.com/post/2247</link><guid isPermaLink="true">https://community.m5stack.com/post/2247</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sat, 29 Dec 2018 07:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to &quot;double click&quot; on Thu, 27 Dec 2018 13:30:11 GMT]]></title><description><![CDATA[<p dir="auto">I will start from here:</p>
<pre><code>#include &lt;M5Stack.h&gt;

boolean State1 = false;
boolean State2 = false;

long buttonTimer = 0;
long longPressTime = 250;

boolean buttonActive = false;
boolean longPressActive = false;

void setup() {
  M5.begin();
  Serial.begin(115200);

}

void loop() {

  if (M5.BtnB. read() == HIGH) {

    if (buttonActive == false) {

      buttonActive = true;
      buttonTimer = millis();

    }

    if ((millis() - buttonTimer &gt; longPressTime) &amp;&amp; (longPressActive == false)) {

      longPressActive = true;
      State1 = !State1;
      Serial.println("LONG");

    }

  } else {

    if (buttonActive == true) {

      if (longPressActive == true) {

        longPressActive = false;

      } else {

        State2 = !State2;
        Serial.println("SHORT");

      }

      buttonActive = false;

    }

  }
  M5.update();
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/2243</link><guid isPermaLink="true">https://community.m5stack.com/post/2243</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Thu, 27 Dec 2018 13:30:11 GMT</pubDate></item></channel></rss>