Introduction

Have you been fed up with Black/White LCD screen? Do you want to try a colorful one? DFRobot I2C 16x2 Arduino LCD with RGB Backlight Display module will bring you a new experience about screen. It comes with RGB full color backlight, which has 16 million kinds of color. Usually, Arduino LCD display projects will run out of pin resources easily, especially with Arduino Uno. And it is also very complicated with the wire soldering and connection. This I2C 16x2 LCD Screen is using an I2C communication interface. It means it only needs 4 pins for the LCD display: VCC, GND, SDA, SCL. It will saves at least 4 digital / analog pins on Arduino. And Gravity interface make it easier to use with our Gravity: IO expansion shield.

Specification

Board Overview

Gravity: I2C LCD1602 RGB Backlight Module

Num Label Description
1 VCC 3.3~5.0V
2 GND GND
3 SCL I2C-SCl
4 SDA I2C- SDA

Tutorial

In this section, we 'll demonstrate a fade effect with different color.

Requirements

Connection Diagram

Sample Code

Please download the LCD library: DFRobot RGB LCD. How to install Libraries in Arduino IDE

/*!
  * file SetColor.ino
  * brief SetColor.
  * @n This example Set the volume size and play music snippet.
  *
  * 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_RGBLCD.h"
int r,g,b;
int t=0;

DFRobot_RGBLCD 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);
}

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 Backlight Display from DFRobot Store or DFRobot Distributor.

Turn to the Top