I am using Xport and Sparkfun RGB Led Matrix for my project. They both work great individually. However, when I combine the codes xport doesn’t work.

My Xport code is based on the Tom Igoe’s code and Hernando Barragan’s USB weatherboard code. RGB led matrix code is based on the halfmachine.dk code.

Here some of the code:

void setup() {
  // Xport setup
  pinMode(deviceResetPin, OUTPUT);
  pinMode(ledPin, OUTPUT);

  //RGB Matrix setup

  // Diagnostics

void loop() {
  // Xport loop

  // RGB Matrix loop

Xport only gets two characters and prints D (which means disconnected).

Altough, when I comment out the writeMatrix function from the void loop(), Xport works. Is it the delays in the writeMatrix() which causes the problem? Delay in a function is affecting working speed of an another function?

Here is the writeMatrix function:

  for(int display = 0;display <12;display++)
    digitalWrite(clock, LOW);    //sets the clock for each display, running through 0 then 1
    digitalWrite(data, LOW);    //ditto for data.

    digitalWrite(cs[display], LOW);     //ditto for cs.
    for(int x = 0; x < 8;x++)
      for (int y = 0 ; y < 8;y++)
        writeByte(displayPicture[display][x][y], display); //Drawing the grid. x across then down to next y then x across.
    digitalWrite(cs[display], HIGH);

I am stuck, I could post more of the code if it will be helpful,