// LCD1602 to Arduino Uno connection example
#include <LiquidCrystal.h>
int potpin = 0;
int val;
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
lcd.print("Voltmeter");
}
void loop() {
// ...
lcd.setCursor(0, 1);
val = analogRead(potpin); // 0 to 1023
float voltage = map(val, 0, 1023, 0, 500)/100.00;
String display = String(voltage) + " (V)";
lcd.print(display);
}