// Analog Pin Configuration
const int analogPin = 34; // Example: Analog sensor connected to pin 34
void setup() {
Serial.begin(115200); // Initialize Serial Monitor
pinMode(analogPin, INPUT); // Set the analog pin as an input
}
void loop() {
// Read the analog value (0-4095) from the sensor
int analogValue = analogRead(analogPin);
// Convert the raw value to a voltage (assuming 3.3V reference)
float voltage = (analogValue * 3.3) / 4095.0;
// Print the raw value and the voltage to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue);
Serial.print(" -> Voltage: ");
Serial.println(voltage, 2);
delay(1000); // Delay for 1 second before the next reading
}