     SPI settings
   */
 
-  //SPI.setDataMode(SPI_MODE0);
-
   // Declare MISO as output : have to send on
   //master in, *slave out*
   pinMode(MISO, OUTPUT);

ISR (SPI_STC_vect)
{

  if (spireq == 0) {
    //we have nothing to send, grab a new command
    byte cmd = SPDR;
    switch (cmd) {
    case 'R': //ask for radio input and get ESC output
      spireq = 1;
      ibyte=0;

      // update rc_data
      rc_data.un = unThrottleInShared;

      //prepare for next interrupt
      SPDR = rc_data.b[ibyte+1];
    };

    return;
  }

  switch (spireq){
  case 1:
    if (spicount <= spimax_R){
      //echange values byte per byte

      //grab inputs
      esc_data.b[ibyte] = SPDR;

      //prepare for next call
      if (ibyte == 0) ibyte++;
      SPDR = rc_data.b[ibyte-1];

      spicount++;

    } else {
      //we finished send RC values
      Serial.print("Finished transaction :");
      Serial.print(esc_data.un);
      Serial.print(" ");
      Serial.println( rc_data.un);

      //prepare for next request
      SPDR = 0;
      spireq = 0;
      ibyte = 0;
    }
  }

}


//define Servo variables
Servo MOTOR[SERVO_NUM];

//define SPI data
byte cmd;
volatile union int_byt{
  uint8_t u8[2];
  uint16_t u16;
} rc_data[4], esc_data[4];

//setup function
void setup()
