8x8 RGB LED Matrix Board
Create fun and blinky displays with your Raspberry Pi, Arduino or other device with an SPI bus with this 8x8 RGB LED Matrix Board from PMD Way.
Each board is fully-assembled with 64 square RGB LEDs and is compatible with both 5V and 3.3V signals.
Free delivery, worldwide.
Raspberry Pi setup:
Wiring:
Raspberry Pi |
RPI-RGB-LED-Matrix |
5V |
VCC |
GND |
GND |
GPIO11 (BCM) |
CLK |
GPIO8 (BCM) |
CE |
GPIO10 (BCM) |
MOSI |
GCC example code:
1. After power on and login to system. you can open a terminal and edit /boot/config.txt file to enable SPI function.
sudo vim.tiny /boot/config.txt
and input those parameters:
device_tree=bcm2710-rpi-3-b.dtb
dtparam=spi=on
2.Edit a file named it matrix.c and input following paragraph:
sudo vim.tiny matrix.c
and input those code:
#include <stdio.h>
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include <stdint.h>
#define RED_DATA 0
#define BLUE_DATA 1
#define GREEN_DATA 2
int main(void)
{
static uint8_t data[4] = {0x0,0x0,0x0,0x0};
wiringPiSetup();
wiringPiSPISetup(0,500000);
while(1)
{
static uint8_t heart[8] = {0x00, 0x66, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18};
int j;
int x=2;
for ( j=0;j<8;j++)
{
data[0] = ~heart[j];
data[2] = 0xFF;
data[1] = 0xFF;
data[3] = 0x01 << j ;
wiringPiSPIDataRW(0,data,sizeof(data));
delay(x);
};
};
}
3.Compile it and run it.
sudo gcc -o matrix matrix.c -lwiringPi
sudo ./matrix
Easy!