 //LED pin for checking
 #define LED_PIN 13
 
-// These bit flags are set in bUpdateFlagsShared to indicate which
-// channels have new signals
-#define THROTTLE_FLAG 1
-#define YAW_FLAG 2
-#define PITCH_FLAG 4
-#define ROLL_FLAG 8
+//For ease of programming
+#define THR 0
+#define YAW 1
+#define PITCH 2
+#define ROLL 3
 
 // Assign your channel in pins
 #define THROTTLE_IN_PIN 8

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;
    }
  }

}


    SPI settings
  */

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