[Help]New to LCDs and Arduino Uno

I’ve found a tutorial on YouTube though it didn’t explained alot…
I’ve connected the pins just like in the video, even searched for a datasheet for my LCD, here’s the video BTW:

I made a little bit of code, compiled it, -fine and dandy.
But when I look on my WH1602D-YGK-HP LCD, I saw it is just blinking all of the dots on the screen.

Here’s the code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16 , 2);
  lcd.clear();
  
}

void loop() {
  lcd.print("Printing...");
  
  delay(2000);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("Setting a cursor");
  
  delay(2000);
  lcd.clear();
  lcd.print("Blinking cursor");
  lcd.blink();
  
  delay(2000);
  lcd.clear();
  lcd.noBlink();
  lcd.print("ULine cursor");
  lcd.cursor();
  
  delay(2000);
  lcd.print("No Cursor");
  lcd.cursor();
  
  delay(2000);
  lcd.clear();
  lcd.print("No display");
  delay(1000);
  lcd.noDisplay();
  
}

Have you amended the code to correspond with how you set up your LCD?

So have you wired it so that: LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

corresponds to LiquidCrystal(rs, enable, d4, d5, d6, d7)?

(That looks like pins 4, 6 and 11-14 on your LCD).

I saw it is just blinking all of the dots on the screen.

Does this really mean that you saw dots, or did you see rectangular blocks?

If it was rectangular blocks was it all 32 of them or just the top 16?

How often did the blinking occur?

Have you ever been able to get your LCD to display a simple message? If not then you really should start there.

You do not need an lcd.clear after lcd.begin, that's done as part of the initialization.

You generally don't want to use an lcd.clear if you don't have to, especially in loop(). You can usually just reset the cursor and overwrite the old message.

Once you do the 'no display' at the end of the first transit of the loop how do you expect to ever see anything on the display again?

Don

Dr_Ugi:
Have you amended the code to correspond with how you set up your LCD?

So have you wired it so that: LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

corresponds to LiquidCrystal(rs, enable, d4, d5, d6, d7)?

(That looks like pins 4, 6 and 11-14 on your LCD).

Checked it.
I’ve compiled the code from the forums that counts time…
I characters just blink, but in a pattern…
Like
? = 1
/ = 2
! = 3

And so on…

/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the 
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

You might try something like the following:

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  String tempOutString = String(millis()/1000)
  lcd.print(tempOutString);
}