#define POT_PIN 34 // Define the analog pin
void setup() {
Serial.begin(115200); // Start serial communication
}
void loop() {
int potValue = analogRead(POT_PIN); // Read the potentiometer value (0-4095)
float voltage = (potValue / 4095.0) * 5.0; // Convert to voltage (0-5V)
Serial.print("Potentiometer Value: ");
Serial.print(potValue);
Serial.print(" | Voltage: ");
Serial.println(voltage, 3); // Print voltage with 3 decimal places
delay(500); // Wait for half a second
}