need help with SPI between Arduino Yun and Arduino Mega

Hello guys, i am trying to make Arduino Yun and Mega to communicate. Im trying to send a Matrix (eg A[11] ) with 11 slots that every slot contains one int variable. im trying to sent it from the slave to the master but i cant get it to work, it sends junk. or it sends nothing, there is no pattern to what data i get…
i have been searching the past 1 week and tested many codes i found and changed them to try and to my work but no result.

can anyone help me with this? has anyone done anything similar? can you post a code that works and makes some kind of communication to transfer one number?

note that i am using the Yun as the Master and the Mega as the Slave

this is the Master code

#include <SPI.h>

// Matrix to save the incomming data from the slave
int jj[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
long int timer = 0;
void setup (void)
{
  Serial.begin (115200);
  Serial.println ();
  int SS = 10;
  pinMode(SS, OUTPUT);
  digitalWrite(SS, HIGH);  // ensure SS stays high for now

  // Put SCK, MOSI, SS pins into output mode
  // also put SCK, MOSI into LOW state, and SS into HIGH state.
  // Then put SPI hardware into Master mode and turn SPI on
  SPI.begin ();

  // Slow down the master a bit
  SPI.setClockDivider(SPI_CLOCK_DIV8);

}  ////////////////////////////////////////////////////////////////////////////////////
// sendong the data to the slave with this small code and getting back
byte transferAndWait (const byte what)
{
  byte ab = SPI.transfer(what);
  delayMicroseconds (40);
  return ab;
} /////////////////////////////////////////////////////////////////////////////////////

void loop (void)
{
  if (timer < millis())
  {
    // enable Slave Select
    digitalWrite(SS, LOW);

    /
    transferAndWait (1); //with '1' i request from the slave to receive the 1st number and so on
    jj[1] = transferAndWait (2);
    jj[2] = transferAndWait (3);
    jj[3] = transferAndWait (4);
    jj[4] = transferAndWait (5);
    jj[5] = transferAndWait (6);
    jj[6] = transferAndWait (7);
    jj[7] = transferAndWait (8);
    jj[8] = transferAndWait (9);
    jj[9] = transferAndWait (10);
    jj[10] = transferAndWait (11);
    jj[11] = transferAndWait (100); //sent some junk just to get the last number of the matrix

    // disable Slave Select
    digitalWrite(SS, HIGH);

    for (int i = 1; i <= 11; i++)
    {
      Serial.println(jj[i]);
    }

    timer = millis() + 10000;
  }


  delay (1000);  // 1 second delay
}

and this is the slave code

// what to do with incoming data
volatile byte command = 0;

// Matrix to be sent to the master
int jj[11] = {22, 24, 19, 1, 2, 3, 4, 5, 6, 7, 8};
void setup (void)
{

  // have to send on master in, *slave out*
  pinMode(MISO, OUTPUT);

  // turn on SPI in slave mode
  SPCR |= _BV(SPE);

  // turn on interrupts
  SPCR |= _BV(SPIE);

}  /////////////////////////////////////////////////////////////////////////////////


// SPI interrupt routine
ISR (SPI_STC_vect)
{
  byte c = SPDR;
  command = c;
  switch (command)   //maybe like this i can sent the data one by one?
  {

    case '1':

      SPDR = jj[1];
      break;


    case '2':
      SPDR = jj[2];
      break;


    case '3':
      SPDR = jj[3];
      break;

    case '4':
      SPDR = jj[4];
      break;

    case '5':
      SPDR = jj[5];
      break;

    case '6':
      SPDR = jj[6];
      break;

    case '7':
      SPDR = jj[7];
      break;

    case '8':
      SPDR = jj[8];
      break;

    case '9':
      SPDR = jj[9];
      break;

    case '10':
      SPDR = jj[10];
      break;

    case '11':
      SPDR = jj[11];
      break;

  } //////////////////////////////////////////////////////////////////// end of switch

}  //////////////////////////////// end of interrupt service routine (ISR) SPI_STC_vect

void loop (void)
{
//here i will do things with sensors that change the values in the jj Matrix

}
    case '10':

Can you post a picture of your keyboard with the 10 key circled?

Single quotes are for SINGLE characters.

Why do you assume that the data is character data?

ok that could be also a single char, ok, anyway, all this doesn't work, if '10' was the problem then all the previous data should be ok. but they are not.

If none of the data sent is '0' or '1' or any character value between '0' and '9', then, of course, no action would happen.

you can see the code... you can see that i send 0-9 and then 10 and 11 but ok, take out the last two, shouldn't it work with the previous data? explain what you say and stop talking like a smartass, i just asked for help and you are just spamming non helping comments so far...

you can see that i send 0-9 and then 10 and 11

Yes, and then you check for having received '0', '1', etc.

Here's some news: 0 != '0'.