#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
}
int pot = 0;
int prev_pos = -1;
void loop() {
// int pot = analogRead(A0);
int pos_pot = pot/(1024.0/210);
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(pot); lcd.print(" = "); lcd.print(pos_pot);
if (pos_pot != prev_pos) {
prev_pos = pos_pot;
Serial.print(pot); Serial.print(" = "); Serial.println(pos_pot);
}
if (pot < 1023) {
++pot;
}
//delay(500);
}