HELP with 5x9 Led matrix with two 74hc595

Hi,
I’ve some time working in a matrix of 5 rows and 9 columns. And I’ve run into the problem that I can not show a circle. I used two shift registers. In the first 5 outputs of the first 74hc595 I connected the 5 rows and in the remaining, part of the columns. The rest of the columns it connected to another 74hc595 that is in cascade with the first.

int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

int counter = 0;
int LEDs[5][9] = {
  {0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0}
};

int ojocentrado[5][9] = {
  {0,0,0,0,1,1,1,0,0},
  {0,0,0,1,1,1,1,0,0},
  {0,0,1,1,0,1,1,0,0},
  {0,0,1,1,1,1,0,0,0},
  {0,0,1,1,1,0,0,0,0}
};

int ojoderecha[5][9] = {
  {0,0,0,1,1,1,0,0,0},
  {0,0,1,1,1,1,0,0,0},
  {0,1,1,0,1,1,0,0,0},
  {0,1,1,1,1,0,0,0,0},
  {0,1,1,1,0,0,0,0,0}
};

void setup()
{
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop()
{
  if (counter < 50) {
    lightLED(ojocentrado);
  }
  if (counter > 50) {
    lightLED(ojoderecha);
  }
  if (counter > 100) {
    counter = 0;
  }
  counter++;
}

void lightLED(int tempLED[5][9]) {
  byte columnbitsToSend = 0;
  byte rowbitsToSend = 0;
  
  int x = 0;
  int y = 0;
  for (x = 0; x < 9; x++) {
    columnbitsToSend = 0;
    rowbitsToSend = 0;
    
    
    for (y = 0; y < 5; y++) {
      if (tempLED[x][y] == 1) {
        bitWrite(rowbitsToSend, y, HIGH);
      }
    }
    
    digitalWrite(latchPin, LOW);
    bitWrite(columnbitsToSend, x, HIGH);
    shiftOut(dataPin, clockPin, MSBFIRST, columnbitsToSend);
    shiftOut(dataPin, clockPin, MSBFIRST, rowbitsToSend);
    digitalWrite(latchPin, HIGH);
    delay(2);
  }
}

I can not showing anything and I do not understand. I’ve looked at a lot of places: instructables, some forums even arduino, and nothing. I do not get to create a sketch that I work with my array. If anyone can help me to find the fault I would appreciate it.

Also I try using this other sketch, to learn how it works, but I do not get out well. In this I think the problem is that the accounts have not done well. The sketch is based on the first LED light, then the next in the row and then when it reach the end go to the next line and so all the time.

//pin connections- the #define tag will replace all instances of "latchPin" in your code with A1 (and so on)
#define latchPin A1
#define clockPin A0
#define dataPin A2

//looping variables
byte i;
byte j;

//storage variable
byte dataToSend;

void setup() {
  //set pins as output
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  
  for (i=0;i<5;i++){
    
    for (j=0;j<9;j++){
      
      //bit manipulation (more info at http://arduino.cc/en/Reference/Bitshift ,  http://arduino.cc/en/Reference/BitwiseXorNot , and http://arduino.cc/en/Reference/BitwiseAnd)
      dataToSend = (1 << (i+10)) | (255 & ~(1 << j));//preprare byte (series of 8 bits) to send to 74HC595
      //for example when i =2, j = 3,
      //dataToSend = (1 << 6) | (15 & ~(1 << 3));
      //dataToSend = 01000000 | (15 & ~(00001000));
      //dataToSend = 01000000 | (15 & 11110111);
      //dataToSend = 01000000 | (15 & 11110111);
      //dataToSend = 01000000 | 00000111;
      //dataToSend = 01000111;
      //the first four bits of dataToSend go to the four rows (anodes) of the LED matrix- only one is set high and the rest are set to ground
      //the last four bits of dataToSend go to the four columns (cathodes) of the LED matrix- only one is set to ground and the rest are high
      //this means that going through i = 0 to 3 and j = 0 to three with light up each led once
      
      // setlatch pin low so the LEDs don't change while sending in bits
      digitalWrite(latchPin, LOW);
      // shift out the bits of dataToSend to the 74HC595
      shiftOut(dataPin, clockPin, LSBFIRST, dataToSend);
      //set latch pin high- this sends data to outputs so the LEDs will light up
      digitalWrite(latchPin, HIGH);
      
      delay(500);//wait
    }
  }
  
}

Can anyone help me?

I can not showing anything

Does that mean that at no time is any LED lit?

I suggest to start smaller. Just make a small 2x2 LED matrix (or only wire up 2 rows and 2 columns of your 5x9) and use only one shift register. Feed it with all possible numbers 0-15 and see which combinations light up what.

If nothing happens then we need to worry about the wiring.