int potPin = 34;
int potValue = 0;
float voltage = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
potValue = analogRead(potPin);
// For ESP32, ADC is 12-bit (0–4095)
voltage = potValue * (3.3 / 4095.0);
Serial.print("POT Value: ");
Serial.print(potValue);
Serial.print(" Voltage: ");
Serial.print(voltage, 2);
Serial.println(" V");
delay(500);
}