Program to print “Hello, world!” in a 16 * 2 LCD using Arduino Uno (Part 2 of 2)

<<< Read previous part (Part 1)

After completing the circuit given in part 1, upload the following program to your arduino board. This program will print “hello, world!” in the liquid crystal display.

/*
 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);
}

If uploading is successful, “hello, world!” and seconds will be printed in the liquid crystal display.

Next : Steps for programming ATtiny45 / ATtiny85 using Arduino Uno >>>

(Visited 999 times, 1 visits today)
paulpp644

A deep electronic enthusiast who spent most of my time for electronic experiments. I am also interested in publishing my experiments in my blog for helping other electronics enthusiasts.