// Define the ADC pin to use on the ESP32-C3
// Use any ADC-enabled pin, for example, GPIO1
const int sensorPin = 3;
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(sensorPin);
// Print the voltage to the Serial Monitor
Serial.print("Voltage: ");
Serial.print(millivolts);
Serial.println(" mV");
// Wait a moment before the next reading
delay(1000);
}