    Serial.println(accelgyro.testConnection() ? "IMU connection successful":"IMU connection failure");
 }
 
+/*
+ * Initialise the loudness sensor
+ */
 void initialiseLoudnessSensor()
 {
    Wire.beginTransmission(ADDR_ADC121);        // transmit to device

   Wire.endTransmission();  
}

void updateAccelerationAndGyro() {
   accelgyro.getMotion6(&ax,&ay,&az,&gx,&gy,&gz);//get the gyro and accelarator   
   //==========accelerator================================

    return start+index;
}

/*
 * Buffer the current sensor measurements
 */
int bufferSensorData(int start) 
{
  if (start < 0) 
  {
    return -1;  
  }
  
  char text[] = { '#', 'M', 'E', 'A', 'S', 'U', 'R', 'E', 'M', 'E', 'N', 'T', '|' };

  start = copyOver(text, buffer, 13, start);
