LCD Text Flickering

Hi!

I’m relatively new to Arduino.
I tried printing some text to a LCD that i got with my Arduino Starter Kit.
But when i print the text, half of the line is just flickering (Look at the attachment).

This is the code i used:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){

    // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
}

void loop(){   
    lcd.clear();
    // read all the available characters
    lcd.print("TestTestTestTest");
    
}

This is how i have set up the circuit: http://arduino.cc/en/uploads/Tutorial/LCD_bb.png

Perhaps you should understand what every function in the library does.
Ask your self, "what does lcd.clear() do?", then ask yourself "why does the screen flicker?"

Try to write code that updates the display once; instead of every loop cycle.

This is fairly easy to do by using an "if" statement to verify that a variable has changed before writing to the display.

The previous comment is correct; you are clearing the display then writing your test message, it repeats so quick that it looks like it's flickering.

I’m late to the party but when I read the title I knew I would find an ‘lcd.clear’ in loop() after I opened the thread.

The problem is that you modified a sketch that has ‘variable’ input from the serial monitor to print a ‘static’ message. Messages that don’t change should be sent to the display in setup().

Your sketch boils down to this:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
lcd.begin(16, 2);
lcd.print("TestTestTestTest");
}

void loop(){    
}

Don

Thanks! as soon as i read the other messages i understood my problem. I did it latae last night when i was tired. I like your solution more than the others though :slight_smile: made me understand better! Thanks!