   if(yaw == 0xFF) { // 0xFF represents 360 degrees
     yaw = 0; // This makes sense since 0 and 360 degrees are the same place
   }
+  IMU.closeSPI(); // End SPI transaction
+}
 
-  IMU.closeSPI(); // End SPI transaction
-  
-  // Transmit IMU data via ADF7242
+// Transmit IMU data via ADF7242
+void sendWirelessSensorData() {
   Tx.configSPI(); // Begin SPI transaction
   Tx.dummySPIWrite(); // Dummy write to force SPI Mode change
   delay(1);

void setup() {
  
  SPI.begin(); //Start SPI
  
  // Reminder in terminal that you're in DEBUG mode
  #ifdef DEBUG
    Serial.begin(9600); // Baud rate was set arbitrarily
    Serial.println("**********DEBUG MODE**********");
  #endif

  // ADIS16480 IMU configuration
  IMU.configSPI();          // Begin the SPI transaction

  Tx.regWrite(0x084, yaw); // Write yaw data to ADF7242 packet buffer
  Tx.transmit();  // Transmit packet buffer
  Tx.closeSPI();  // End SPI transaction
}

// Transmit IMU data via USB Serial port.
void sendSerialSensorData() {
  Serial.write(roll); // Write roll data to serial connection
  Serial.write(pitch); // Write pitch data to serial connection
  Serial.write(yaw); // Write yaw data to serial connection
  Serial.write(serialSyncWord); // Write synchronization word to serial connection
}

// Interrupt routine will grab data from the IMU and transmit it via the ADF7242 and SPI
void transmitData() {
  grabSensorData();
  sendWirelessSensorData();
  sendSerialSensorData();
}

void loop() {
  
  // Program is entirely interrupt driven. Nothing to do here!
  
}

