LED Matrix Example Code

I have tried to use the example code that comes with the IDE for LED MAtrix Control. I modified it slightly to light up each LED one at a time scanning across columns and rows. However, something weird is happening. When you write to row 0 as in myMatrix.write(0,0) it writes to the bottom row (i.e. 7), then myMatrix.write(1,0) writes to row 0, myMatrix.write(2,0) to row 1, etc.

Here is the code…

#include <Sprite.h>
#include <Matrix.h>

Matrix myMatrix = Matrix(2, 4, 3);

void setup()

void loop()
  myMatrix.clear(); // clear display

for (int i=0; i < 8; i++) {
  for (int j=0; j<8; j++) {
    myMatrix.write(i+1, j, HIGH);


Any ideas please?

Writing to row 7 lights up row 6. Wiring is correct according to the MAX chip and the Dot Matrix being used.

If I don't use the Matrix.h library and use my own code it works fine so it is not a wiring issue.

Any ideas anyone?

Is there a newer version of the matrix library anywhere?