#define POT_PIN 20 // Replace with your ADC pin
void setup() {
Serial.begin(115200);
analogReadResolution(12); // 12-bit resolution
}
void loop() {
int adcValue = analogRead(POT_PIN);
float voltage = (adcValue / 4095.0) * 3.3; // Convert ADC value to voltage
Serial.print("ADC Value: ");
Serial.print(adcValue);
Serial.print(" | Voltage: ");
Serial.println(voltage);
delay(100);
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1