<?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[Get Bottom2 power connection status with a code.]]></title><description><![CDATA[<p dir="auto">How can I monitor the status of the power connection through the pogo pins on the Bottom2 module? Are there any specific methods or code examples for detecting power presence or absence?</p>
<pre><code>M5.Lcd.setCursor(startX, currentY);
float vinVoltage = M5.Axp.GetVinVoltage();
bool hasUsbPower = (vinVoltage &gt; 4.5);
bool hasBackPower = M5.Axp.isCharging(); // Check if charging via any source
M5.Lcd.setTextColor(WHITE);
M5.Lcd.print(F("USB-C: "));
M5.Lcd.setTextColor(hasUsbPower ? PAL_GREEN : RED);
M5.Lcd.printf("%.1fV", vinVoltage);
currentY += lineSpacing;

M5.Lcd.setCursor(startX, currentY);
M5.Lcd.setTextColor(WHITE);
M5.Lcd.print(F("Back: "));
M5.Lcd.setTextColor(hasBackPower ? PAL_GREEN : RED);
if (hasBackPower &amp;&amp; !hasUsbPower) { // Only show back power if it's the source
    M5.Lcd.printf("%.1fV", M5.Axp.GetVBusVoltage());
} else {
    M5.Lcd.print(" --");
}
currentY += lineSpacing;

// Check battery level
M5.Lcd.setCursor(startX, currentY);
float batteryLevel = M5.Axp.GetBatteryLevel();
M5.Lcd.setTextColor(WHITE);
M5.Lcd.print(F("Battery: "));
M5.Lcd.setTextColor(batteryLevel &gt; 20 ? PAL_GREEN : RED);
M5.Lcd.printf("%d%%", (int)batteryLevel);
currentY += lineSpacing;
</code></pre>
]]></description><link>https://community.m5stack.com/topic/7091/get-bottom2-power-connection-status-with-a-code</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:02:11 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7091.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Dec 2024 08:39:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Get Bottom2 power connection status with a code. on Wed, 18 Dec 2024 10:15:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ioamas" aria-label="Profile: ioamas">@<bdi>ioamas</bdi></a><br />
According to the schematic diagram, the 5V of the Pogo pin is directly connected to the VIN pin. So I think maybe you can determine whether the Pogo pin is connected by judging whether the battery is connected</p>
]]></description><link>https://community.m5stack.com/post/27497</link><guid isPermaLink="true">https://community.m5stack.com/post/27497</guid><dc:creator><![CDATA[kuriko]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:15:40 GMT</pubDate></item></channel></rss>