Gravity I2C 8x16 RGB LED Matrix Panel SKU DFR0522

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

  • Operating Voltage: 5.0V
  • Operating Current: ≤150mA
  • Communication: IIC/I2C
  • LED Backlight: RGB Adjustable (7 colors)
  • Operating Temperature: 0-70℃
  • Size: 2.44in x 1.06in (62mm x 27mm)

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

Print String

Prototype:void print(String ,unsigned char color)
  • Function: Print a string in the panel.
  • Parameters:
    • String: string, with “ ” enclosed
    • Color: color to show
      • Red: RED
      • Green: GREEN
      • Yellow: YELLOW
      • Blue: BLUE
      • Purple: PURPLE
      • Cyan: CYAN
      • White: WHITE

E.g.

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

void setup() {
}

void loop() {
  panel.print("DF1", BLUE); //Display DF1 in BLUE
}

Print Numbers and Variables

Prototype:void print(int val,unsigned char color)
  • Function: Print Numbers and Variables in the plane.
  • Parameters:
    • Val: int values or int variables
    • Color: color to show
      • Red: RED
      • Green: GREEN
      • Yellow: YELLOW
      • Blue: BLUE
      • Purple: PURPLE
      • Cyan: CYAN
      • White: WHITE

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)
  • Function: Scroll Display
  • Parameters:
    • Scroll in left: Left
    • Scroll in right: Right
    • Stop scroll: None

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)
  • Function: Spicify a pixel to show
  • Parameters:
    • x:pixel position in x direction(value:0~7)
    • y:pixel position in y direction(value:0~15)
    • Color: color to show
      • Red: RED
      • Green: GREEN
      • Yellow: YELLOW
      • Blue: BLUE
      • Purple: PURPLE
      • Cyan: CYAN
      • White: WHITE

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();
  • Function: Clear the display.
  • Parameters: None

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)
  • Function:
  • Parameters:
    • Color: color to show
      • Red: RED
      • Green: GREEN
      • Yellow: YELLOW
      • Blue: BLUE
      • Purple: PURPLE
      • Cyan: CYAN
      • White: WHITE

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)
  • Function: show built-in 23 images in the display panel, number as 0~22.
  • Parameters:
    • Color: color to show
      • Red: RED
      • Green: GREEN
      • Yellow: YELLOW
      • Blue: BLUE
      • Purple: PURPLE
      • Cyan: CYAN
      • White: WHITE

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](https://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

  • [Hardware Design Resource](https://github.com/Arduinolibrary/DFRobot_Gravity_I2C_8x16_RGB_LED_Matrix_Panel/raw/master/[DFR0522]RGB LED 8x16 Display Panel_V1.0_.pdf)