Displaying Hello World on LCD : Learn Arduino

Displaying Hello World on LCD

In this article we’ll learn displaying hello world on LCD; Interfacing 16×2 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)

Circuit Diagram for Interfacing 16×2 LCD with Arduino Uno:

Circuit Diagram for Interfacing 16×2 LCD with Arduino Uno

The Code:

#include<LiquidCrystal.h>
 
//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

Comments

avatar
  Subscribe  
Notify of