<?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 - Micropython - USB plugged in]]></title><description><![CDATA[<p dir="auto">Is it possible using UIFlow/Blockly to detect when USB is plugged in? From other threads (<a href="https://forum.m5stack.com/topic/3611/detecting-when-plugged-in-vs-when-charging" target="_blank" rel="noopener noreferrer nofollow ugc">https://forum.m5stack.com/topic/3611/detecting-when-plugged-in-vs-when-charging</a>) it looks like I need to be able to implement this:</p>
<p dir="auto"><code>M5.Axp.isACIN();</code></p>
]]></description><link>https://community.m5stack.com/topic/5021/uiflow-micropython-usb-plugged-in</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 02:00:08 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5021.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Feb 2023 17:03:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UIFlow - Micropython - USB plugged in on Fri, 03 Feb 2023 22:35:26 GMT]]></title><description><![CDATA[<p dir="auto">The python version of the c function looks like its probably not available:</p>
<pre><code>&gt;&gt;&gt; dir(hardware.axp192.Axp192)
['__class__', '__init__', '__module__', '__name__', '__qualname__', '__bases__', '__dict__', 'deinit', 'setBusPowerMode', 'powerAll', 'setLCDBrightness', 'setPowerLED', 'setSpkEnable', 'powerOff', 'CURRENT_100MA', 'CURRENT_190MA', 'CURRENT_280MA', 'CURRENT_360MA', 'CURRENT_450MA', 'CURRENT_550MA', 'CURRENT_630MA', 'CURRENT_700MA', 'getTempInAXP192', 'getChargeState', 'getBatVoltage', 'getBatCurrent', 'getVinVoltage', 'getVinCurrent', 'getVBusVoltage', 'getVBusCurrent', 'setChargeState', 'setChargeCurrent', 'setLDOVoltage', 'setLDOEnable', 'setDCVoltage', 'disableAllIRQ', 'clearAllIRQ', 'enableBtnIRQ', 'setESPVoltage', 'setLCDBacklightVoltage', 'setLCDEnable', 'setLCDReset', 'setVibrationIntensity', 'setVibrationEnable', '_regChar', '_read8bit', '_read12Bit', '_read13Bit', '_read16Bit']
&gt;&gt;&gt; 
</code></pre>
<p dir="auto">However, I found two alternative ways to detect this, i2c being my favorite: <a href="https://imgur.com/a/nscmAHF" target="_blank" rel="noopener noreferrer nofollow ugc">https://imgur.com/a/nscmAHF</a></p>
]]></description><link>https://community.m5stack.com/post/20005</link><guid isPermaLink="true">https://community.m5stack.com/post/20005</guid><dc:creator><![CDATA[jjshoe]]></dc:creator><pubDate>Fri, 03 Feb 2023 22:35:26 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow - Micropython - USB plugged in on Thu, 02 Feb 2023 18:18:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/crami25" aria-label="Profile: crami25">@<bdi>crami25</bdi></a> said in <a href="/post/19990">UIFlow - Micropython - USB plugged in</a>:</p>
<blockquote>
<p dir="auto">You can use this function in UIFlow:<br />
Whenever the USB is plugged in, the battery is charged.<br />
You will find the block in the Hardware/Power section:<br />
<img src="/assets/uploads/files/1675361595669-889f78b8-6ae1-44c8-90f4-57ad1873112a-image.png" alt="0_1675361595278_889f78b8-6ae1-44c8-90f4-57ad1873112a-image.png" class=" img-fluid img-markdown" /></p>
</blockquote>
<p dir="auto">Actually <code>isCharging</code> returns false after the battery goes full for a while, I realize I can then do logic to check the battery capacity, and <code>isCharging</code>, was just hoping there was a simpler way.</p>
]]></description><link>https://community.m5stack.com/post/19991</link><guid isPermaLink="true">https://community.m5stack.com/post/19991</guid><dc:creator><![CDATA[jjshoe]]></dc:creator><pubDate>Thu, 02 Feb 2023 18:18:32 GMT</pubDate></item><item><title><![CDATA[Reply to UIFlow - Micropython - USB plugged in on Thu, 02 Feb 2023 18:13:33 GMT]]></title><description><![CDATA[<p dir="auto">You can use this function in UIFlow:<br />
Whenever the USB is plugged in, the battery is charged.<br />
You will find the block in the Hardware/Power section:<br />
<img src="/assets/uploads/files/1675361595669-889f78b8-6ae1-44c8-90f4-57ad1873112a-image.png" alt="0_1675361595278_889f78b8-6ae1-44c8-90f4-57ad1873112a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/19990</link><guid isPermaLink="true">https://community.m5stack.com/post/19990</guid><dc:creator><![CDATA[crami25]]></dc:creator><pubDate>Thu, 02 Feb 2023 18:13:33 GMT</pubDate></item></channel></rss>