I am working on a project using 3 pots and an i2c lcd module, The first line is just text, the second will read out 3 values of the pots which will later read out values of RGB LEDs. I got the readings coming in to the arduino, and the information displaying to the lcd, the first line is perfect, the problem i have is in the second line, i am displaying the 3 values spread a crossed the second line. right now they are reading between 1023 and 0, if i run the lcd.clear() the cleans blanks out, if i use lcd.write(" ") to clear the second line the numbers flash so fast they almost fade away and its hard to read. Im wondering if there is a way to clear the screen and write the values to the screen in a solid display ?
if i only write 3 spaces to clear the line the 3 value will clear and write perfect, the other 2 will clear and write but the number comes up with odd numbers depending on how fast i turn the pot
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
//set the LCD address to 0x27 for a 16 chars and 2 line display
int potPinb = 0;
int potPing = 1;
int potPinr = 2;
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Webbspinner Inc.");
}
void loop()
{
int potValb = analogRead(potPinb);
int potValg = analogRead(potPing);
int potValr = analogRead(potPinr);
//lcd.clear();
String value = potValb + " ";
String value1 = potValg + " ";
String value2 = potValr + " ";
lcd.setCursor ( 0, 1 );
lcd.print(potValb);
lcd.setCursor ( 5, 1 );
lcd.print(potValg);
lcd.setCursor ( 10, 1 );
lcd.print(potValr);
lcd.setCursor ( 0, 1 );
lcd.print(" "); <---- this line seems to be the problem
}