keyestudio
Share your creative ideas with us here
By Alisa | 25 March 2024 | 0 Comments

How to Make 8x8 LED Dot Matrix Display a“❤”Pattern?

1.Introduction
 

The dot-matrix display is an electronic digital display device that can show information on machines, clocks and many other devices. In this project, we will use the PLUS mainboard to control the 8x8 LED dot matrix to make a“❤”pattern.


2.Components Required
 

img

img

img

img

Keyestudio Plus Mainboard*1

8*8 Dot-matrix Display *1

F-F Dupont Wires

USB Cable*1


3.Component Knowledge
 

8

8*8 Dot-matrix display module:

The 8*8 dot matrix is composed of 64 LEDs, and each LED is placed at the intersection of a row and a column. When using a single-chip microcomputer to drive an 8*8 dot matrix, we need to use a total of 16 digital ports, which greatly wastes the data of the single-chip microcomputer. For this reason, we specially designed this module, using the HT16K33 chip to drive an 8*8 dot matrix, and only need to use the I2C communication port of the single-chip microcomputer to control the dot matrix, which greatly saves the microcontroller resources.
 

Specifications:

  • Working voltage: DC 5V

  • Current: 200MA

  • Maximum power: 1W
     

Schematic diagram:


 

4.Wiring Diagram
 


5.Code
 

Note: The library file needs to be installed in the code. If the “Matrix” library file has been added, ignore the process of adding the library file below.

Put the decompressed “Matrix” folder into “Arduino libraries” under the compiler installation directory.

After successful placement, you need to restart the compiler, otherwise the compilation will not work.

e.g:C:\Program Files\Arduino\libraries

/*
8_8_Matrix
http//www.keyestudio.com
*/
#include <Matrix.h>
Matrix myMatrix(A4,A5);
uint8_t LedArray1[8]={0x00,0x18,0x24,0x42,0x81,0x99,0x66,0x00};
uint8_t  LEDArray[8];
void setup(){
myMatrix.begin(0x70);
}

void loop(){
  myMatrix.clear();
  for(int i=0; i<8; i++)
  {
    LEDArray[i]=LedArray1[i];
    for(int j=7; j>=0; j--)
    {
      if((LEDArray[i]&0x01)>0)
      myMatrix.drawPixel(j, i,1);
      LEDArray[i] = LEDArray[i]>>1;
    }
  }
  myMatrix.writeDisplay();
}


6.Result
 

After burning the test code, connecting the wires and powering on, 8*8 dot-matrix screen displays a “❤” pattern.


7.Setup
 

Set the display image

The display pattern can be set with the following code:

uint8_t LedArray1[8]={0x00,0x18,0x24,0x42,0x81,0x99,0x66,0x00};

Place the dot matrix horizontally

Convert 0x00,0x18,0x24,0x42,0x81,0x99,0x66,0x00 to binary numbers

0x00 is 0 0 0 0 0 0 0 0

0x18 is 0 0 0 1 1 0 0 0

0x24 is 0 0 1 0 0 1 0 0

0x42 is 0 1 0 0 0 0 1 0

0x81 is 1 0 0 0 0 0 0 1

0x99 is 1 0 0 1 1 0 0 1

0x66 is 0 1 1 0 0 1 1 0

0x00 is 0 0 0 0 0 0 0 0

The first hexadecimal data represents the control of the first column of LEDs, and the second data represents the control of the second column of LEDs and so on.

The setting method is to convert to a binary 8-bit value. “0” means that the LED is off, and “1” means that the LED is on. The first converted value is to control the first line of LEDs on and off, and so on.

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code