Displaying Hello World on LCD : Learn Arduino

In this article we’ll learn displaying hello world on LCD; Interfacing 16x2 LCD with Arduino Uno and display some text on it. Writing Hello World pleases the gods of any new programming language that you want to learn. But in case of Arduino it is the LED blinking program that is generally written first. Any ways, Hello World can certainly be second if not the first so let’s roll!

Parts needed:

  1. Arduino Uno
  2. 16 x 2 LCD
  3. Some jumper wires

Approximate Cost: ₹ 125 ($ 2)

The Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include   

//Initialize LCD with interface pins
//Pin Description: REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN
LiquidCrystal lcd(0, 1, 8, 9, 10, 11);

void setup() {
//Initialize LCD's number of columns and rows (16,2)
lcd.begin(16, 2);
}

void loop() {
//Set the cursor to column 0, line 0
lcd.setCursor(0, 0);

lcd.print("Hello World to Circuitry!");

//Delay of 0.75 sec
delay(750);

//Shift data to the left
lcd.scrollDisplayLeft();
}

Finally check and upload the code. Read this article to know how to upload and run the code.

References:

  1. 16 x 2 LCD Datasheet
  2. My simulation of this project on Tinkercad
  3. Arduino Howto