// Define the ADC pin to use on the ESP32-C3
// Use any ADC-enabled pin, for example, GPIO1
const int in1 = 0;
const int in2 = 1;
const int in3 = 4;
void setup() {
// Initialize Serial communication
Serial.begin(115200);
// You do not need to set the attenuation with this function
// It handles the configuration internally to get a calibrated reading
}
void loop() {
// Read the analog value and get the calibrated voltage in millivolts
uint32_t millivolts = analogReadMilliVolts(in1);
// Print the voltage to the Serial Monitor
Serial.print("Voltage: ");
Serial.print(millivolts);
Serial.print(" mV\t");
millivolts = analogReadMilliVolts(in2);
Serial.print("Voltage: ");
Serial.print(millivolts);
Serial.print(" mV\t");
millivolts = analogReadMilliVolts(in3);
Serial.print("Voltage: ");
Serial.print(millivolts);
Serial.println(" mV");
// Wait a moment before the next reading
delay(1000);
}