<?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[Simulate button press?]]></title><description><![CDATA[<p dir="auto">Is there a way to simulate a button press in code?  I'm looking for a <code>M5.BtnA.press()</code>.  I've tried pulling GPIO pins low for a quick delay, then back high again, like this:</p>
<pre><code>    digitalWrite(38, LOW);
    delay(100);
    digitalWrite(38, HIGH);
</code></pre>
<p dir="auto">Not only does that not work, I'm afraid I'd lose debouncing.  Any ideas?</p>
]]></description><link>https://community.m5stack.com/topic/522/simulate-button-press</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Mar 2026 15:07:04 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/522.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Jan 2019 16:45:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Simulate button press? on Tue, 22 Jan 2019 17:09:59 GMT]]></title><description><![CDATA[<p dir="auto">Well, I have a couple of spots in my project that a button press would make things very easy.  For example, I'm using M5ez for my interface, and use Blynk to display events on the M5 screen.  I have backlight timeout set to 30 seconds.  A new event doesn't turn the backlight back on, but a keypress does.  So, in my <code>if (newEvent)</code> loop, I could have a <code>M5.BtnA.press()</code>,  that would wake up the screen.  Can I go into the M5ez library, figure out what happens after a real button press to wake the screen and replicate that?  Yes, of course, and I have certainly tried that, but some of the items that need to be set are private, so calling them from a main loop is problematic.  Rewriting that stuff so it's all public might work, but that solves one problem.  I'd also like menus to time out - if there's no activity after going into a menu, I'd like it to time out and go back to the main menu.  Again, code can certainly make that happen, but a <code>M5.BtnA.press()</code> would be a lot easier to implement...   Does this make sense?</p>
]]></description><link>https://community.m5stack.com/post/2632</link><guid isPermaLink="true">https://community.m5stack.com/post/2632</guid><dc:creator><![CDATA[BrianR]]></dc:creator><pubDate>Tue, 22 Jan 2019 17:09:59 GMT</pubDate></item><item><title><![CDATA[Reply to Simulate button press? on Tue, 22 Jan 2019 05:31:13 GMT]]></title><description><![CDATA[<p dir="auto">I'm wondering what is your purpose for simulating a button press? maybe there could be an alternative solution for your problem</p>
]]></description><link>https://community.m5stack.com/post/2624</link><guid isPermaLink="true">https://community.m5stack.com/post/2624</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Tue, 22 Jan 2019 05:31:13 GMT</pubDate></item><item><title><![CDATA[Reply to Simulate button press? on Mon, 21 Jan 2019 04:54:45 GMT]]></title><description><![CDATA[<p dir="auto">Yup, <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/480">@heybin</a>, you're indeed right.  Short of soldering a wire from an available GPIO to the switch itself, I don't see anything in the buttons library that could even be modified to allows for this functionality.  It's either so simple that I just can't see the answer, or impossible (without a soldering iron involved)...</p>
]]></description><link>https://community.m5stack.com/post/2591</link><guid isPermaLink="true">https://community.m5stack.com/post/2591</guid><dc:creator><![CDATA[BrianR]]></dc:creator><pubDate>Mon, 21 Jan 2019 04:54:45 GMT</pubDate></item><item><title><![CDATA[Reply to Simulate button press? on Mon, 21 Jan 2019 01:45:47 GMT]]></title><description><![CDATA[<p dir="auto">hello,  gpio 38 in esp32 only input</p>
]]></description><link>https://community.m5stack.com/post/2582</link><guid isPermaLink="true">https://community.m5stack.com/post/2582</guid><dc:creator><![CDATA[heybin]]></dc:creator><pubDate>Mon, 21 Jan 2019 01:45:47 GMT</pubDate></item></channel></rss>