<?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[Core2: Python API to get battery charge level]]></title><description><![CDATA[<p dir="auto">Is there a Python API to get battery charge level for the Core2 battery?</p>
<p dir="auto">I found power.<em>getChargeState()</em> but it just returns true/false (charging/discharging). There is also <em>power.getBatVoltage()</em> which could be an indication of the charge level but would need some additional math to calculate the percentage.</p>
]]></description><link>https://community.m5stack.com/topic/3184/core2-python-api-to-get-battery-charge-level</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 14:09:52 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3184.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Apr 2021 06:30:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Core2: Python API to get battery charge level on Tue, 13 Apr 2021 11:48:27 GMT]]></title><description><![CDATA[<p dir="auto">Thanks. I checked on the Core2 and here battery voltage also ranges from about 3.2V to 4.2V.</p>
]]></description><link>https://community.m5stack.com/post/13510</link><guid isPermaLink="true">https://community.m5stack.com/post/13510</guid><dc:creator><![CDATA[ondrej1024]]></dc:creator><pubDate>Tue, 13 Apr 2021 11:48:27 GMT</pubDate></item><item><title><![CDATA[Reply to Core2: Python API to get battery charge level on Mon, 12 Apr 2021 14:26:08 GMT]]></title><description><![CDATA[<p dir="auto">Should work if you replace line</p>
<pre><code>volt = axp.getBatVoltage()
</code></pre>
<p dir="auto">with</p>
<pre><code>volt = power.getBatVoltage()
</code></pre>
<p dir="auto">Battery discharge characteristics should be the same +/- some small variations independently of battery capacity.</p>
]]></description><link>https://community.m5stack.com/post/13504</link><guid isPermaLink="true">https://community.m5stack.com/post/13504</guid><dc:creator><![CDATA[robalstona]]></dc:creator><pubDate>Mon, 12 Apr 2021 14:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to Core2: Python API to get battery charge level on Mon, 12 Apr 2021 13:08:18 GMT]]></title><description><![CDATA[<p dir="auto">I see that your code applies to the M5stickC. Do you think the table is the same for the M5 Core2?</p>
]]></description><link>https://community.m5stack.com/post/13502</link><guid isPermaLink="true">https://community.m5stack.com/post/13502</guid><dc:creator><![CDATA[ondrej1024]]></dc:creator><pubDate>Mon, 12 Apr 2021 13:08:18 GMT</pubDate></item><item><title><![CDATA[Reply to Core2: Python API to get battery charge level on Mon, 12 Apr 2021 12:28:34 GMT]]></title><description><![CDATA[<p dir="auto">I found table with voltage and according percentage on internet and make this code</p>
<p dir="auto"><a href="https://github.com/stonatm/UiFlow-custom-blocks/blob/master/battery-capacity/battery.py" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/stonatm/UiFlow-custom-blocks/blob/master/battery-capacity/battery.py</a></p>
<p dir="auto">ewentually you could calculate with formula something like this, but it is not accurate.</p>
<pre><code>percentage = int( (battery_voltage - 3.20) * 100)
</code></pre>
]]></description><link>https://community.m5stack.com/post/13501</link><guid isPermaLink="true">https://community.m5stack.com/post/13501</guid><dc:creator><![CDATA[robalstona]]></dc:creator><pubDate>Mon, 12 Apr 2021 12:28:34 GMT</pubDate></item></channel></rss>