#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 14, 27, 26, 25);
int potentiometer = 34;
int counter = 0;
int prevCounter = 0;
void setup() {
lcd.begin(16, 2);
lcd.print("Counter: ");
}
void loop() {
counter = map(analogRead(potentiometer), 0, 4095, 0, 10);
if(counter != prevCounter) {
lcd.setCursor(10, 0);
lcd.print(" ");
lcd.setCursor(10, 0);
lcd.print(counter);
prevCounter = counter;
}
delay(100);
}