int potPin = A0; // Analog pin where the sensor is connected
int dt = 500; // Delay time in milliseconds
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud
pinMode(potPin, INPUT);
}
void loop() {
int potValue = analogRead(potPin); // Read analog value from the sensor
float voltage = (potValue * 5.0) / 1023.0;
// Print the analog value and its corresponding voltage
Serial.print("Potentiomenter Reading = ");
Serial.print(potValue);
Serial.print(",");
Serial.print(" Analog Voltage Reading ")
delay(dt); // Wait for 500 milliseconds before the next reading
}