#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int a=A0;
void setup() {
lcd.begin(16,2);
lcd.setCursor(6,0);
}
void loop() {
int s=analogRead(a);
lcd.setCursor(6,0);
lcd.print(s);
lcd.setCursor(6,1);
switch (s) {
case 0:
lcd.print("Min");
break;
case 512:
lcd.print("Half");
break;
case 1023:
lcd.print("Max");
break;
delay(500);
lcd.clear();
lcd.noDisplay();
delay(500);
lcd.display();
delay(500);
}
}