RPI-RGB-LED-Matrix SKU:EP-0043: Difference between revisions

From 52Pi Wiki
Jump to navigation Jump to search
Line 77: Line 77:
4.Run it.<br>
4.Run it.<br>
<code>sudo  ./matrix</code><br>
<code>sudo  ./matrix</code><br>
----
5.You will see it ligths up.
5.You will see it ligths up.
----
----

Revision as of 14:57, 15 July 2016

RPI-RGB-LED-Matrix

Description

RPI-RGB-LED-Matrix is base on 74HC595 chip and it's a 8x8 matrix that you can make a small toy with it.
It communicates with your development board or your chip with SPI protocol, it's very easy to setup and use.
You can use arduino or raspberry Pi, even STC89C51 chip to driving it.
You can use it to do a lot of interesting things, such as musical backdrop, music spectrum analyzer , and even in your bicycle taillights.


Feature

  • Based on 74HC595 chip support
  • Support SPI protocol
  • Low power consumption
  • RGB three-color combination can be a lot of bright colors

Presentation

这里等待图片。


Package includes

  • 1x RPI-RGB-LED-Matrix module

How to wire it up

这里缺少图片。


How to use it

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

   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

#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] = {0xEF,0xFF,0xFF,0x04};
  static uint8_t i = 0;

  wiringPiSetup();
  wiringPiSPISetup(0,500000);
  while(1){
	  data[0] = 0xF7;
	  data[2] = 0xFF;
	  data[1] = 0xFF;
	  data[3] = 0x01;
	  wiringPiSPIDataRW(0,data,sizeof(data));
 	  delay(2);
	  data[0] = 0xF3;
          data[2] = 0xFF;
	  data[1] = 0xFF;
   	  data[3] = 0x02;
	  wiringPiSPIDataRW(0,data,sizeof(data));
	  delay(2);
  }
}


3.Compile it.
sudo gcc -o matrix matrix.c -lwiringPi
4.Run it.
sudo ./matrix
5.You will see it ligths up.


Purchase Links

Shopping car.png

52Pi Store