// Define the analog input pin
#define ADC_PIN 34
// Variable to store the ADC value
int adcValue = 0;
void setup() {
// Initialize serial communication
Serial.begin(9600);
// If using ESP32, you can set ADC resolution and attenuation (optional):
analogReadResolution(12); // Default is 12 bits (0-4095)
analogSetAttenuation(ADC_11db); // For full-scale range (up to 3.3V on ESP32)
}
void loop() {
// Read the ADC value
adcValue = analogRead(ADC_PIN);
// Print the ADC value to the Serial Monitor
Serial.print("ADC Value: ");
Serial.println(adcValue);
// Wait for a short time before the next reading
delay(500);
}