Search code examples
arduinoarduino-unoarduino-idelcd

LCD not displaying character using Arduino Uno


As it mention in the title, LCD is not displaying String it is displaying weird character. Here is the code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  lcd.begin(16, 2);
   Serial.begin(9600);
   lcd.print("hello, world!");

}

void loop() {
    lcd.setCursor(0, 1);
    lcd.print(millis()/500); 
}

and here is what the LCD diplays:

See image enter image description here


Solution

  • This can have several reasons:

    • the display hardware is broken (but i don't think so, its showing something, but wrong characters)
    • the connections from arduino to the display are wrong
    • at least one connection cable is broken (these small cables break very often at the connector ...)

    It's also possible that you drive the display in wrong mode. The data connections can be half-bytes (4 bits) or bytes (8 bits) at once, i.e. you connect either 4 or 8 data cables. The driver must then set the correct mode, else the communication doesn't work correctly (i.e. if you set 8 bit mode and connect 4 cables, the upper 4 bits will have either random or 0 values).

    Please check the hardware connections.