       prevTime = micros();
     } 
     loopCount++; 
-
 }
 // ************************************************************************************************************
 // Helper Functions

  ACC_getADC(); // read raw accel data

  for(axis = 0; axis < 3; axis++)
    accelFloat[axis]=accADC[axis]; // raw data from int array to float array also give the option to filter if necessary 
  
    static uint16_t previousT;
    uint16_t currentT = micros(); // set current time 

    rollAngle -= deltaGyroAngle[1]; //riemann sum  
    

    float pitchAccel = atan2(accLPF[1],accLPF[2]) * RADTODEG; // determine the pitch of Acc vector using atan2 function
    float rollAccel = atan2(accLPF[0],accLPF[2]) * RADTODEG;  // determine the roll of Acc vector using atan2 function

    accVectorMagnitude = sqrt(pow(accADC[0],2) + pow(accADC[1],2) + pow(accADC[2],2))/495.f; // calc of of Acc vector magnitude, could be simplified 

    if(accVectorMagnitude < 1.3 && accVectorMagnitude > 0.7) // if !bullshit Acc vector must be <1.3g && >0.7g
    {
      if(!(abs(rollAngle) > 85))
        pitchAngle = pitchAngle * GYROWEIGHT + pitchAccel * (1 - GYROWEIGHT); // complementary filter 
      if(!(abs(pitchAngle) > 85))
        rollAngle = rollAngle * GYROWEIGHT + rollAccel * (1 - GYROWEIGHT);    // complementary filter 
    }

    else // for debuging purposes only triggered if Acc magnitude is out of bounds
    {
      //Serial.print("THROWOUT!!!!!!!!!!!!!!!!!!!!!!!!!!");
      //Serial.print("\t\t");
      display.drawFastHLine(0,10,30,1);
    }

    if(pitchAngle > 180)
      pitchAngle = -180 + (pitchAngle - 180);
    else if(pitchAngle < -180)
      pitchAngle = 180 + (pitchAngle + 180);

    if(rollAngle > 180)
      rollAngle = -180 + (rollAngle - 180);
    else if(rollAngle < -180)
      rollAngle = 180 + (rollAngle + 180);

    serialPrintDebug(pitchAccel); //prints to Serial for debug
     
