int pot = A0;    
int led = 2;      
int value;  
float voltage;

void setup() {
  pinMode(led, OUTPUT);  
  Serial.begin(9600);
}

void loop() {
  value = analogRead(pot); 
  voltage = value*5.0/1023;
  // measurement
  Serial.write(27); 
  Serial.print("[2;5H"); 
  Serial.print("Measurement "); 
  Serial.print(value); 
  Serial.print(" units   ");  
  // voltage
  Serial.write(27); 
  Serial.print("[4;5H"); 
  Serial.print("Voltage "); 
  Serial.print(voltage); 
  Serial.print(" V   ");    
  // voltage bar
  Serial.write(27); 
  Serial.print("[6;5H"); 
  for (int t=0; t<value/50;t++){
    Serial.print("#");
  }
  for (int t=value/50; t<=1023/50;t++){
    Serial.print(" ");
  }
  delay(500);                  
}
