Example Code for Arduino-Basic Functions
download the sample code to the DFRduino UNO R3, and after a successful upload, the dazzling color effects of the RGB matrix panel will be visible. This sample code will fill the RGB LED matrix panel with red, green and blue in sequence, and display the text "DFRobot".
Hardware Preparation
- DFRduino UNO R3 (or similar) x1
- Gravity: I2C 8x16 RGB LED Matrix Panel x1
- IIC Data Line x1
Software Preparation
- Arduino IDE (Version requirements: V1.6. ), Click to Download Arduino IDE from Arduino®
Wiring Diagram

Other Preparation Work
Connect hardware according to the PinOut instruction, download Sample Code to the DFRduino UNO R3 (or similar).
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);
}
Result
Result: Fill in RGB LED Panel in RED, GREEN and BLUE respectively, and show ”DFRobot”.
Was this article helpful?
