TTGO-T-Display ESP32

I need several analog inputs for my project. If I use input 36 the analog input reads fine.
The problem is if I define more inputs, they all show up only as pin 36. Example: set input 39 with 3.3 volts, the reading of the pin 39 is 0 but pin 36 is 4095 with 0 volts on pin 36..

My test:
// Potentiometer is connected to GPIO 34 (Analog ADC1_CH6)
const int potPin = 36;
const int potPin2 = 39;

// variable for storing the potentiometer value
int potValue = 0;
int potValue2 = 0;

void setup() {

void loop() {
// Reading potentiometer value
potValue = analogRead(potPin);
potValue = analogRead(potPin2);
Serial.print("36 is ");
Serial.print("39 is ");


@urfalo, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

potValue = analogRead(potPin);
potValue = analogRead(potPin2);

Look very carefully at those 2 lines of code and check they are really doing what you think.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.