#include <Servo.h>
Servo myServo;
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
int potpin(A0);
int potvalue;
int volt;
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
pinMode(potpin, INPUT);
myServo.attach(3);
}
void loop() {
// put your main code here, to run repeatedly:
potvalue = analogRead(potpin);
volt = map(potvalue,0,1023,0,5);
lcd.print("Voltage = ");
lcd.print(volt);
lcd.println(" ");
lcd.setCursor(0,0);
potvalue = map(potvalue, 0, 1023, 0, 180);
myServo.write(potvalue);
delay(200);
}