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

20x4lcd Program2

This document contains code for testing a 20x4 LCD display module using an Arduino and the LiquidCrystal_I2C library. The code initializes the LCD with the I2C address, turns on the backlight, and prints a series of test messages scrolling across 4 lines on the display over 1 second intervals to demonstrate functionality.

Uploaded by

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

20x4lcd Program2

This document contains code for testing a 20x4 LCD display module using an Arduino and the LiquidCrystal_I2C library. The code initializes the LCD with the I2C address, turns on the backlight, and prints a series of test messages scrolling across 4 lines on the display over 1 second intervals to demonstrate functionality.

Uploaded by

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

//Circuit Blocks LCD Test Software v1.

0 for 20x4 LCD


//revised code from http://arduino-info.wikispaces.com/LCD-Blue-I2C#v3 for LCD
test

// Get the LCD I2C Library here:


// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Download 'LiquidCrystal_V1.2.1.zip'. Install downloaded library.
// Move any other LCD libraries ('C:\Documents\Arduino\libraries') to another
folder or delete them.

#include <LiquidCrystal_I2C.h>
#include <Wire.h> // Comes with Arduino IDE

LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD


I2C address

void setup()
{
lcd.begin(20,4); // initialize the lcd for 20 chars 4 lines, turn on
backlight

// ------- Quick 3 blinks of backlight -------------


//this is not really important as it will only toggle the backlight on and off
//you can remove or comment these next 8 lines
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on

//-------- Write characters on the display ------------------


lcd.setCursor(4,0); //Start at character 4 on line 0
lcd.print("Hello World!");
delay(1000);

lcd.setCursor(2,1); //Start at character 2 on line 1


lcd.print("20x4 LCD module");
delay(1000);

lcd.setCursor(0,2); //Start at character 0 on line 2


lcd.print("fb.com/circuitblocks");
delay(1000);

lcd.setCursor(1,3); //Start at character 1 on line 3


lcd.print("circuitblocksph.com");
}

void loop()
{
//loop
}

You might also like