when I read data from potentiometer every time calculate positive numbers because of lcd.setCursor.
But I don't know how to solve this problem. I write the code below.
#define BACKLIGHT_PIN 13 #include <LiquidCrystal_I2C.h> #include <Encoder.h>
Encoder potansiometer(6,7);
LiquidCrystal_I2C lcd(0x27,20,4); // Set the LCD I2C address
Hi, and welcome to the forum.
Your code is incomplete, and I don't fully understand the question.
What do you want to display.
Assuming you have an Arduino Uno, then the 10-bit A/D returns 0-1023.
Maybe you're looking for the map() function, to shift that into a range you want.
int newPosition = map(analogRead(A0), 0, 1023, -999, 999); // something like that?
Leo..