Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views1 page

LCD Display

This document contains an Arduino sketch that initializes a 16x2 LCD display using the LiquidCrystal_I2C library. It displays the messages 'Hello World!' and 'Jairo' on the LCD with a delay between each character. The program includes cursor positioning, clearing the display, and backlight control for the LCD.

Uploaded by

Jairo Daquioag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

LCD Display

This document contains an Arduino sketch that initializes a 16x2 LCD display using the LiquidCrystal_I2C library. It displays the messages 'Hello World!' and 'Jairo' on the LCD with a delay between each character. The program includes cursor positioning, clearing the display, and backlight control for the LCD.

Uploaded by

Jairo Daquioag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <Wire.

h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars
and 2 line display

void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight(); // Turn on the LCD screen backlight
}

void loop()
{
char arr[] = "Hello World!"; // Let the compiler determine the size automatically
char arr1[] = "Jairo";
int stringLength = strlen(arr);
int strlngth = strlen(arr1);

for (int i = 0; i < stringLength; i++) {


lcd.setCursor(i, 0); // Set cursor position for each character
lcd.print(arr[i]);
delay(100); // Reduce delay for faster display
}
delay(1000);
lcd.clear();
delay(2000);

for (int j = 0; j < strlngth; j++) {


lcd.setCursor(j, 0); // Set cursor position for each character
lcd.print(arr1[j]);
delay(100); // Reduce delay for faster display
}
delay(1000);
lcd.clear();
delay(2000);
}

You might also like