multiplexing 15x5

Hi, I have a problem with my multiplexing of a 15x5 led matrix.

The problem is that leds on the top row will not light unless the led directly below on the bottom line has been lit.
So for example if I want to write a “7” it will write a “1” but writing a “L” is ok. This is not the case however for the rest of the lines.
Seems to be a bleeding effect from the previous line…

1 1 1 0 0 1 1 0 0
0 0 1 0 0 1 1 0 0
0 0 1 becomes 0 0 1 but 1 0 0 is ok
0 0 1 0 0 1 1 1 1

Here is my code:

//pin vars
int tmp36 = 13;
int lightSens = 12;
int latchPin = 5;
int dataPin = 4;
int clockPin = 3;
int pulsePin = 8;
int resetPin = 7;

//placeholder vars
int tusen;
int hundre;
int ti;
int x;
int xto = 10;

//other
word bitsToSend;
unsigned long currentMillis;
unsigned long previousMillis;

void setup()

{
  pinMode (latchPin, OUTPUT);
  pinMode (dataPin, OUTPUT);
  pinMode (clockPin, OUTPUT);
  pinMode (pulsePin, OUTPUT);
  pinMode (resetPin, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  
  x = 7777;
  
  //define chars
  byte character[][11] = {
  {B111,B101,B101,B101,B111},
  {B010,B010,B010,B010,B010},
  {B111,B001,B111,B100,B111},
  {B111,B001,B111,B001,B111},
  {B101,B101,B111,B001,B001},
  {B111,B100,B111,B001,B111},
  {B111,B100,B111,B101,B111},
  {B100,B100,B100,B100,B111},
  {B111,B101,B111,B101,B111},
  {B111,B101,B111,B001,B001},
  {B110,B101,B101,B101,B110},
  {B110,B101,B110,B101,B110},
  };
  
  //Splitting input into digits
  //1000-9999
  if (x > 999 && x <= 1999)
  {
    x = x - 1000;
    tusen = 1;
  }
  else if (x > 1999 && x <= 2999)
  {
    x = x - 2000;
    tusen = 2;
  }
  else if (x > 2999 && x <= 3999)
  {
    x = x - 3000;
    tusen = 3;
  }
  else if (x > 3999 && x <= 4999)
  {
    x = x - 4000;
    tusen = 4;
  }
  else if (x > 4999 && x <= 5999)
  {
    x = x - 5000;
    tusen = 5;
  }
  else if (x > 5999 && x <= 6999)
  {
    x = x - 6000;
    tusen = 6;
  }
  else if (x > 6999 && x <= 7999)
  {
    x = x - 7000;
    tusen = 7;
  }
  else if (x > 7999 && x <= 8999)
  {
    x = x - 8000;
    tusen = 8;
  }
  else if (x > 8999 && x <= 9999)
  {
    x = x - 9000;
    tusen = 9;
  }
  else tusen = 0;

  //99-999
  if (x > 99 && x <= 199)
  {
    x = x - 100;
    hundre = 1;
  }
  else if (x > 199 && x <= 299)
  {
    x = x - 200;
    hundre = 2;
  }
  else if (x > 299 && x <= 399)
  {
    x = x - 300;
    hundre = 3;
  }
  else if (x > 399 && x <= 499)
  {
    x = x - 400;
    hundre = 4;
  }
  else if (x > 499 && x <= 599)
  {
    x = x - 500;
    hundre = 5;
  }
  else if (x > 599 && x <= 699)
  {
    x = x - 600;
    hundre = 6;
  }
  else if (x > 699 && x <= 799)
  {
    x = x - 700;
    hundre = 7;
  }
  else if (x > 799 && x <= 899)
  {
    x = x - 800;
    hundre = 8;
  }
  else if (x > 899 && x <= 999)
  {
    x = x - 900;
    hundre = 9;
  }
  else hundre = 0;
  
  //10-99
  if (x > 9 && x <= 19)
  {
    x = x - 10;
    ti = 1;
  }
  else if (x > 19 && x <= 29)
  {
    x = x - 20;
    ti = 2;
  }
  else if (x > 29 && x <= 39)
  {
    x = x - 30;
    ti = 3;
  }
  else if (x > 39 && x <= 49)
  {
    x = x - 40;
    ti = 4;
  }
  else if (x > 49 && x <= 59)
  {
    x = x - 50;
    ti = 5;
  }
  else if (x > 59 && x <= 69)
  {
    x = x - 60;
    ti = 6;
  }
  else if (x > 69 && x <= 79)
  {
    x = x - 70;
    ti = 7;
  }
  else if (x > 79 && x <= 89)
  {
    x = x - 80;
    ti = 8;
  }
  else if (x > 89 && x <= 99)
  {
    x = x - 90;
    ti = 9;
  }
  else ti = 0;
  if (tusen == 0 && hundre == 0 && ti == 0 && x == 0 && xto == 0)
  {
    Serial.println("error: Something is wrong");
  }
  
  digitalWrite(resetPin, HIGH);
  delay(1);
  digitalWrite(resetPin, LOW);
  
  //output
  for (int i = 1; i <= 5; i++)
  {
    //get char and send in order
    bitsToSend = (character[tusen][i]<<13) | (character[hundre][i]<<10) | (character[ti][i]<<7) | (character[x][i]<<4) | (character[xto][i]<<1);
    
    //break up bytes, one for each register
    byte registerTwo = highByte(bitsToSend);
    byte registerOne = lowByte(bitsToSend);
    
    //shift the bytes out:
    shiftOut(dataPin, clockPin, LSBFIRST, registerOne);
    shiftOut(dataPin, clockPin, LSBFIRST, registerTwo);
    digitalWrite(latchPin, HIGH);
    delay(1000);
    digitalWrite(latchPin, LOW);
    
    //count one down on the 4017
    digitalWrite(pulsePin, HIGH);
    digitalWrite(pulsePin, LOW);
  }
}

The secret behind that is multiplexing - I don't see any going on.

what do you mean?

Multiplexing means you are turning rows (or columns) on/off at a quick rate, fooling the eye into thinking all lit LEDs are on at the same time, when in fact they are not.

So, say you had an array that was 5 LEDs across and 15 LEDs from top to bottom.
1 way to have them connected is to have All LEDs in column 1 have their anode connected, all LEDs on column2 would have their anodes connected, etc thru column5.
Then all LEDs in Row1 would have their cathodes connected, same for Row2, etc thru Row15.
To turn on an LED, you drive a column high and a row low, the LED at that intersection turns on.

So to control this matrix:
You would drive the columns by putting out high/low anode data for the top 5 LEDs, then enable that row to be on by taking the cathode for that row low. Any LEDs with high cathode turn on.
Bring the cathode high, put out anode data for row 2, bring the row 2 cathode line low, then high.
Repeat for the rest.
Do this at a 30Hz rate and your eyes will think the ‘on’ LEDs are on all the time and will not see flickering.

Since you have a 1 second delay here, and there is no evidence of columns or rows being commanded on/off, I would say no multiplexing is going on

    //shift the bytes out:
    shiftOut(dataPin, clockPin, LSBFIRST, registerOne);
    shiftOut(dataPin, clockPin, LSBFIRST, registerTwo);
    digitalWrite(latchPin, HIGH);
    delay(1000);

Ok, I see that the code may need some explanation…
See the caps locked text:

// THIS PIECE OF CODE RESETS THE 4017 DECADE COUNTER
digitalWrite(resetPin, HIGH);
  delay(1);
  digitalWrite(resetPin, LOW);
  
  //output THIS CYCLES THROUGH 5 TIMES TO WRITE EACH COLUMN TO ONE OF THE 5 LINES
  for (int i = 1; i <= 5; i++)
  {
    //get char and send in order GETS THE APPROPRIATE CODE FOR THE CURRENT LINE FROM THE ARRAY
    bitsToSend = (character[tusen][i]<<13) | (character[hundre][i]<<10) | (character[ti][i]<<7) | (character[x][i]<<4) | (character[xto][i]<<1);
    
    //break up bytes, one for each register THE REGISTERS ARE TWO 595's
    byte registerTwo = highByte(bitsToSend);
    byte registerOne = lowByte(bitsToSend);
    
    //shift the bytes out:
    shiftOut(dataPin, clockPin, LSBFIRST, registerOne);
    shiftOut(dataPin, clockPin, LSBFIRST, registerTwo);
    digitalWrite(latchPin, HIGH);
    delay(1000);
    digitalWrite(latchPin, LOW);
    
    //count one down on the 4017 HERE IT COUNTS ONE DOWN (NEXT LINE)
    digitalWrite(pulsePin, HIGH);
    digitalWrite(pulsePin, LOW);
//WHEN THE LOOP IS COMPLETE IT WILL READ A NEW VALUE FROM THE SENSORS I HAVE YET TO PROGRAM INTO THE CODE

Edit: The delay is for debugging purposes to see what actually happens.

So you need to post the schematic of what you are driving. The code doesn't make any sense without the context of the hardware. You also need to post the code you are having problems with not some intermediate debug code, otherwise advisory just like compilers will stop at the first error.

A brief look at the code shows you are quite a beginner.