   // calculate amplitude by summing the squares, divide vectors by 100 to keep number manageable
       Adata[f] += (xdata[i]*xdata[i])/100 + (ydata[i]*ydata[i])/100 + (zdata[i]*zdata[i])/100;
     }
-    Adata[f] = sqrt(Adata[f]);  // Amplitude = squareroot of sum of the squares
+    Adata[f] = sqrt(Adata[f]);          // Amplitude = squareroot of sum of the squares
   }
 }
 

     "\"event\": \"" + String(event) + "\" }", PRIVATE);
}

void ReadPressure(int i2c_address)      // function to read pressure/temp from pressure sensor
{
  Wire.beginTransmission(i2c_address);
  Wire.requestFrom(i2c_address,4);       // request 4 bytes of data from sensor
  while(Wire.available())
  {
    pdata[1] = Wire.read();
    pdata[2] = Wire.read();
    pdata[3] = Wire.read();
    pdata[4] = Wire.read();
  }
  Pressure = ((pdata[1]) & 0x3F)<<8 | ((pdata[2]));   // combine 2 bytes of pressure data
  Pressure = (Pressure - 1000)*(250/14000);           // calculate pressure in PSI
  PTemp = ((pdata[3])<<3 | ((pdata[4]) & 0xE0)>>5);   // combine 2 bytes of temp data
  PTemp = (PTemp * 200)/2048 - 50;                    // calculate temp in C
  Wire.endTransmission();
}

void SwitchMux(int select)          // function to change the i2c mux channel
{
  Wire.beginTransmission(MuxI2C);

#include "math.h"         // include math library for sqrt function
#include "High_Temp.h"    // include library for thermocouple
#include <Wire.h>         // include i2c library
#define GAccI2C 0x53      // Grove ADXL345 I2C address is 0x53(83)
#define MuxI2C 0x73       // Digital Mux I2C Address
#define GScaling 0.003901 // 3.9mG per bit A2D Scaling
