32x32 LED Matrix Test Code issue

Hello, I’m new to this forum, so I hope this is the right place to post this.

I just bought a 32x32 RGB LED matrix from adafruit and just tried to get it to work. I followed the instructions on adafruit here, and tried running the test code they provided.

While the code is supposed to make the LED matrix to display this, I get this

The output shown in the second image is not constant. Sometimes the colors are different, and sometimes the entire lines are lit. But it is always those 8 lines. (sometimes the top right pixel lights up randomly too, but usually just those 8 lines)

I’m using the example code as it is given (with the exception of the change made to the pin used for the clock because I’m using the 2560 mega) and I’m pretty sure my connections are correct.

Any ideas as to what could be causing this? Thanks in advance.