int potPin = A0;
int potVal;
float mapVal;
int dt = 250;
void setup() {
// put your setup code here, to run once:
pinMode(potPin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
potVal = analogRead(potPin);
mapVal = (5./1023.) * potVal;
// mapVal = map(potVal, 0, 1023, 0, 5);
Serial.println(mapVal);
delay(dt);
}