Displaying text on a built-in 16x8 LED matrix of Kidbright board
LED Matrix is controlled via an I2C bus at address 0x70. Additional libraries are required to display text on a built-in LED matrix. In this tutorial, I’ll show how to install additional libraries and how to write a program to display a sentence on the built-in 16x8 LED Matrix.
Installing additional libraries
Two libraries are required to display a sentence on LED Matrix: Adafruit_GFX.h and Adafruit_LEDBackpack.h
To install these libraries. Please follow the following instructions:
- From the top menu select Sketch →Include Library →Manage Libraries
- From the library manager, searches for Adafruit_GFX and click install. If the dependencies are not met, a pop-up window will be shown asking for permission to install other dependent libraries, click install all.
3. Repeat step 2 to install Adafruit_LEDBackpack libraries
Write a program to display a sentence on the LED matrix
- Write down the following code into the Arduino IDE
#include <Wire.h>
#include <Adafruit_GFX.h>
#include “Adafruit_LEDBackpack.h”Adafruit_8x16minimatrix matrix = Adafruit_8x16minimatrix();void setup() {
matrix.begin(0x70); // pass in the address
}void loop() {
matrix.setTextSize(1);
matrix.setTextWrap(false); // we don’t want text to wrap so that it can scroll nicely
matrix.setTextColor(LED_ON);
matrix.setRotation(1);for (int8_t x=7; x>=-100; x — ) {
matrix.clear();
matrix.setCursor(x,0);
matrix.print(“Hello World!”);
matrix.writeDisplay();
delay(100);
}
}
2. Compile and upload the program
3. The sentences “Hello World!” should be displayed on the LED screen
Reference: http://quantum.engr.tu.ac.th/smf/index.php?topic=93.0
Note: This article is translated and reformulated to be used as teaching material. It is available to the public for educational proposed.