<?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[t-deck Battery Indicator]]></title><description><![CDATA[<p dir="auto">im working on battery indicator for t-deck for a project im working on , any help</p>
]]></description><link>https://www.community.lilygo.cc/topic/460/t-deck-battery-indicator</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 19:07:15 GMT</lastBuildDate><atom:link href="https://www.community.lilygo.cc/topic/460.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Jun 2023 19:43:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to t-deck Battery Indicator on Mon, 12 Jun 2023 19:33:05 GMT]]></title><description><![CDATA[<p dir="auto">thanks for your reply !</p>
]]></description><link>https://www.community.lilygo.cc/post/820</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/820</guid><dc:creator><![CDATA[abdnatsheh]]></dc:creator><pubDate>Mon, 12 Jun 2023 19:33:05 GMT</pubDate></item><item><title><![CDATA[Reply to t-deck Battery Indicator on Tue, 13 Jun 2023 00:20:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://www.community.lilygo.cc/uid/822">@abdnatsheh</a> I don't have a T-Deck, but this works on my LilyGO T-Display S3</p>
<p dir="auto">Add these lines:</p>
<pre><code>#define BAT_ADC_PIN 4
and the the loop:
  uint32_t voltage = readAdcVoltage(BAT_ADC_PIN) * 2;
  tft.setCursor(50, 70, 4);  //add correct offsets as required for your board
  tft.setTextColor(TFT_RED);
  tft.fillRect(42, 70, 70, 25, TFT_BLACK);//add correct offsets as required
  tft.print(((float)voltage/1000) +0.32);
</code></pre>
<p dir="auto">The ESP32 has a notoriously bad ADC with linearity and offset issues, so this reading cannot be used for scientific observations, only a relative health check.<br />
Also when the USB is hooked up the Battery charge voltage is 5V !!!<br />
You can only see the battery when USB is unplugged.<br />
Hope this helps<br />
-Terry</p>
]]></description><link>https://www.community.lilygo.cc/post/818</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/818</guid><dc:creator><![CDATA[teastain2]]></dc:creator><pubDate>Tue, 13 Jun 2023 00:20:09 GMT</pubDate></item></channel></rss>