<?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[ReadAnalog GPIO12]]></title><description><![CDATA[<p dir="auto">I have started using the Lilygo T-Display-s3, and in my application I connected GPIO12 to  measure an analog voltage between 0 and 3Vdc.<br />
I should be pretty straight forward, I set the PinMode for GPIO12 as INPUT and used the ReadAnalog function with the GPIO12 pin (12)....</p>
<p dir="auto">However, for some reason it does not read the voltage at all....<br />
GPIO12 is supposed to share operation with the ADC2 CH1, is there any setup that is required, that I'm not familiar with?</p>
]]></description><link>https://www.community.lilygo.cc/topic/293/readanalog-gpio12</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 20:17:05 GMT</lastBuildDate><atom:link href="https://www.community.lilygo.cc/topic/293.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Apr 2023 01:05:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ReadAnalog GPIO12 on Thu, 20 Apr 2023 03:47:01 GMT]]></title><description><![CDATA[<p dir="auto">Hi! I used this code, just now to read the battery voltage from GPIO4.<br />
Do not to declare Input as INPUT mode</p>
<p dir="auto">top of the sketch:<br />
#define analogPin 4 //the built in battery voltage test point<br />
float val = 1.23;  //a test number to check if I'm getting a real value</p>
<p dir="auto">in "setup"<br />
Serial.begin(115200);  // be sure to set USB CDC On Boot: "Enabled"</p>
<p dir="auto">The entire test loop:<br />
void loop() {<br />
val = analogRead(analogPin);  // read the input pin<br />
Serial.println(val/1000);          // testing value<br />
delay(1000);<br />
}</p>
<p dir="auto">That's it...I'm getting 2.94VDC.<br />
The ESP32 has terrible ADC capabilities, so this is it!</p>
<p dir="auto">I also have a LilyGO T-Display S3 support page on GitHub here:<br />
<a href="https://github.com/teastainGit/LilyGO-T-display-S3-setup-and-examples" rel="nofollow ugc">https://github.com/teastainGit/LilyGO-T-display-S3-setup-and-examples</a><br />
lots of goodies<br />
-Terry</p>
]]></description><link>https://www.community.lilygo.cc/post/583</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/583</guid><dc:creator><![CDATA[teastain2]]></dc:creator><pubDate>Thu, 20 Apr 2023 03:47:01 GMT</pubDate></item></channel></rss>