Introduction

Accustomed to the same LCD screen, do you want to have a different experience? DFRobot LCD1602 will bring you a new visual feeling, It is not the same as the previous LCD monochrome screen, supports RGB full-color font, can provide 16 million kinds of color combinations. DFRobot Gravity I2C 16x2 Arduino LCD with RGB Font Display use universal Gravity I2C interface, it means only two communication lines, you can realize communication and backlight control. The LCD screen can display 2x16 characters, support screen scrolling, cursor movement and other functions. Through dedicated Arduino library, you can complete all the design without cumbersome wiring and complex code.

Specification

Board Overview

Gravity: I2C 16x2 Arduino LCD with RGB Font Display

Num Label Description
1 VCC Positive Pole
2 GND Negative Pole
3 SCL IIC Clock Line
4 SDA IIC Data Line

Tutorial

Follow the pin description to connect the hardware, and download the sample code to UNO, after upload is successful, you can see the LCD display and backlight gradient.

Requirements

Connection Diagram

Sample Code

Click here to download DFRobot LCD Library(Github) How to install Libraries in Arduino IDE

 /*!
  * file SetColor.ino
  * brief SetColor.
  *
  * Copyright   [DFRobot](http://www.dfrobot.com), 2016
  * Copyright   GNU Lesser General Public License
  *
  * version  V1.0
  * date  2017-2-10
  */

#include <Wire.h>
#include "DFRobot_LCD.h"
int r,g,b;
int t=0;

DFRobot_LCD lcd(16,2);  //16 characters and 2 lines of show

void setup() {
  Serial.begin(9600);
  // initialize
  lcd.init();

}

void loop() {

  r= (abs(sin(3.14*t/180)))*255;          //get R,G,B value
  g= (abs(sin(3.14*(t 60)/180)))*255;
  b= (abs(sin(3.14*(t 120)/180)))*255;
  t=t 3;
  lcd.setRGB(r, g, b);                  //Set R,G,B Value
  lcd.setCursor(0,0);
  lcd.print("DFRobot");
  lcd.setCursor(0,1);
  lcd.print("Gravity: RGB LCD");
  //R:0-255 G:0-255 B:0-255

  delay(1);
}

Expected Results

LCD changes the font color.

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get Gravity: I2C 16x2 Arduino LCD with RGB Font Display from DFRobot Store or DFRobot Distributor.

Turn to the Top