Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 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