Introduction

Single color dot matrix LED displays are common in the market while small RGB displays are in short supply. This Gravity: I2C 8x16 RGB LED Matrix Panel produced by DFRobot has 7 colors and more than 20 images in default, supporting user-defined image setting. It can also show Numbers, Letters and Symbols, and support display scroll. Controlled by IIC agreement, Gravity: I2C 8x16 RGB LED Matrix Panel is easy to connect and convenient to control. Just a special Arduino library can accomplish all designs, which totally free from complex wiring and codes. It can be widely applied to projects like robots, smart home monitoring systems and toy cars…

Specification

PinOut

Gravity-I2C 8x16 RGB LED Matrix Panel Back

Num Label Description
1 + +
2 - -
3 C IIC Clock Line
4 D IIC Data Line

Built-in Images

Gravity-I2C 8x16 RGB LED Matrix Panel Built-in Images

Colors

Gravity-I2C 8x16 RGB LED Matrix Panel Colors

Prototype:void print(String ,unsigned char color)

E.g.

 #include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup() {
}

void loop() {
  panel.print("DF1", BLUE); //Display DF1 in BLUE
}
Prototype:void print(int val,unsigned char color)

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup() {
}

void loop() {
  int a=12;
  panel.scroll(Left);
  panel.print(a, BLUE); //Print variable a in BLUE.
  while(1);
}

Scroll Display

Prototype:void scroll(unsigned char dir)

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup() {
}
void loop() {
  panel.scroll(Left);            //Set to scroll in left
  panel.print("DFRobot", BLUE); //Show "DFRobot" in BLUE
  while(1);
}

Display Pixels

Prototype:void pixel(unsigned char x,unsigned char y,unsigned char color)

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup(){
  Serial.begin(9600);
}

// Set the 1st LED to off, other 7 LEDs show GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE respectively.
void loop(){
  panel.pixel(0,0,QUENCH);
  panel.pixel(0,1,RED);
  panel.pixel(0,2,GREEN);
  panel.pixel(0,3,YELLOW);
  panel.pixel(0,4,BLUE);
  panel.pixel(0,5,PURPLE);
  panel.pixel(0,6,CYAN);
  panel.pixel(0,7,WHITE);
}

Clear Display

Prototype:void clear();

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup(){

}
//Show"DF1"in the panel and flash in every second.
void loop(){
 panel.print("DF1", BLUE);
 delay(1000);
 panel.clear();
 delay(1000);
}

Show All

Prototype:void fillScreen(unsigned char color)

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup(){

}
//Fill in the display panel in BLUE and flash in every second.
void loop(){
 panel.fillScreen(BLUE);
 delay(1000);
 panel.clear();
 delay(1000);
}

Show Built-in Images

Prototype:void display(unsigned char picIndex,unsigned char color)

E.g.

#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup(){
  Serial.begin(9600);
}
//Show No.3 image in RED and flash in every second.
void loop(){
 panel.display(3,RED);
 delay(1000);
 panel.clear();
 delay(1000);
}

Tutorial

Connect hardware accoridng to the PinOut instruction, download Sample Code to the DFRduino UNO R3 (or similar), upload successfully. Then RGB Maxtrix colorful effect could be seen.

Requirements

Connection Diagram

Gravity-I2C 8x16 RGB LED Matrix Panel Connection Diagram

Sample Code

Click to download libraries and examples. How to install Libraries in Arduino IDE.

/*!
 * file DFRobot_RGBPanel_IIC_demo.ino
 *
 * connect RGBPanel and Arduino ,then download this example
 *
 * Copyright   [DFRobot](http://www.dfrobot.com), 2016
 * Copyright   GNU Lesser General Public License
 *
 * version  V0.1
 * date  2017-11-15
 */
#include<Wire.h>
#include <DFRobot_RGBPanel.h>
DFRobot_RGBPanel panel;

void setup() {

}

void loop() {

  String s = "DFRobot";  //Define the string"DFRobot"

  panel.clear();         //Clear the display.
  panel.fillScreen(RED); //Fill in the display in RED for 2s.
  delay(2000);

  panel.clear();          //Clear the display.
  panel.fillScreen(GREEN); //Fill in the display in GREEN.
  delay(2000);             //Show GREEN for 2s.

  panel.clear();
  panel.fillScreen(BLUE); //Fill in the display in BLUE for 2s.
  delay(2000);

  panel.clear();
  panel.scroll(Left);   //Set to scroll in left
  panel.print(s, RED); //Show "DFRobot" in RED
  while(1);
}

Expected Results

Result: Fill in RGB LED Panel in RED, GREEN and BLUE respectively, and show ”DFRobot”.

FAQ

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

More Documents

DFshopping_car1.png Get Gravity: I2C 8x16 RGB LED Matrix Panel from DFRobot Store or DFRobot Distributor.

Turn to the Top