TWI_LCD1602_Module_(SKU__DFR0063) - jimaobian/DFRobotWiki GitHub Wiki

Introduction

I2C/TWI LCD1602 Module (SKU: DFR0063) this is another great lcd display from dfrobot. with the limited pin resources, your project may be out of resources using normal lcd shield. with this i2c interface lcd module, you only need 2 lines (i2c) to display the information. if you already has i2c devices in your project, this lcd module actually cost no more resources at all. fantastic for Arduino based project. Specification

  • Interface: I2C
  • I2C Address: 0x27
  • Back lit (Blue with white char color)
  • Supply voltage: 5V
  • Weight:40 gram

Contrast Adjust

The contrast can be adjusted by the potential-meter displayed in the following picture.

600px Connection Diagram

I2C LCD Connection Diagram connect SDA to pin A4 and SCL to pin A5 on your Arduino.

Library Support Functions

  • LiquidCrystal()
  • begin()
  • clear()
  • home()
  • setCursor()
  • write()
  • print()
  • cursor()
  • noCursor()
  • blink()
  • noBlink()
  • display()
  • noDisplay()
  • scrollDisplayLeft()
  • scrollDisplayRight()
  • autoscroll()
  • noAutoscroll()
  • leftToRight()
  • rightToLeft()
  • createChar()

Sample Code

Download Sample code and library

//DFRobot.com
//Compatible with the Arduino IDE 1.0
//Library version: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

  // Print a message to the LCD.
  lcd.backlight();
  lcd.print("Hello, world!");
}

void loop()
{
}

Sample sketch: Control the back light of the I2C LCD1602 Module

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#if defined(ARDUINO) && ARDUINO >= 100
#define printByte(args)  write(args);
#else
#define printByte(args)  print(args,BYTE);
#endif

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();

  lcd.home();

  lcd.print("Hello world...");
  lcd.setCursor(0, 1);
  lcd.print("dfrobot.com");

}

int backlightState = LOW;
long previousMillis = 0;
long interval = 1000;

void loop(){

  unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;

    if (backlightState == LOW)
      backlightState = HIGH;
    else
      backlightState = LOW;

    if(backlightState == HIGH)  lcd.backlight();
    else lcd.noBacklight();
  }
}

Projects

image:nextredirectltr.pngGo shopping i2c/twi lcd1602 module (sku: dfr0063) category: Product Manual category: DFR Series category: Modules category: source category: Diagram

⚠️ **GitHub.com Fallback** ⚠️