<?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 test if the M5Paper is attached to USB power?]]></title><description><![CDATA[<p dir="auto">I'd like to have different behavior whether the M5paper is running of USB power or battery. I guess I can just try to go to sleep and if it "fails" and I reached the next statement, the I'm on USB power (since you never deep sleep when connected). But is there a more direct way?</p>
]]></description><link>https://community.m5stack.com/topic/3167/how-to-test-if-the-m5paper-is-attached-to-usb-power</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 14:13:14 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3167.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Apr 2021 19:28:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to test if the M5Paper is attached to USB power? on Mon, 12 Apr 2021 05:56:04 GMT]]></title><description><![CDATA[<p dir="auto">Answering my own question. This was trivially simple in my code. My code was doing deep sleep in the <code>setup()</code> function. When waking up from deep-sleep the setup function is called again. But if the device is powered by USB then deep sleep fails and we will reach the <code>loop()</code> function. So any special code that I want for USB power should simply be put in <code>loop()</code>.</p>
]]></description><link>https://community.m5stack.com/post/13498</link><guid isPermaLink="true">https://community.m5stack.com/post/13498</guid><dc:creator><![CDATA[dov]]></dc:creator><pubDate>Mon, 12 Apr 2021 05:56:04 GMT</pubDate></item></channel></rss>