Failing to connect 4 8x8 led matrices

Hello everyone I am new at programming with arduino software, but I know some basic c++ programing and now I faced one problem that I tried to write a code by watching lots of tutorials , even coppied some parts of the code to analyze it. But the problem is then I upload a code to my arduino uno with 4 8x8 matrices nothing happens… Well not nothing happens just my displays blink one by one and doesn’t do the animation that it sopposed to do. so I am asking for some help if you can explain to me what am I doing wrong and what right. Thank you there is the code:

#include "LedControl.h"
int DIN = 12;
int CS = 11;
int CLK = 10;
LedControl lc = LedControl (DIN,CS,CLK,4); // 4 is for matrixes that I am using

void setup(){
  for(int i=0; i<4;i++){
 lc.shutdown(i,false);       //Turns on the matrix
 lc.setIntensity(i,5);      // Sets the brightness of leds in matrix
 lc.clearDisplay(i);         // clears the display

void matrix(byte number_of_unit) {
  for(int row=0;row<8;row++) {
    for(int col=0;col<8;col++){

void loop() {

  for (byte i=0; i<4; i++){

sketch_feb22b.ino (603 Bytes)

Please insert the code in your post (not as attachment); it's small enough. And use code tags when doing so (read the sticky how to use the forum).