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

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

    float pitchAccel = atan2(accelFloat[1],accelFloat[2]) * RADTODEG; // determine the pitch of Acc vector using atan2 function
    float rollAccel = atan2(accelFloat[0],accelFloat[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
    {
      pitchAngle = pitchAngle * GYROWEIGHT + pitchAccel * (1 - GYROWEIGHT); // complementary filter 
      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);
    }

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

        Serial.read();
      }

      //Serial.print(pitchAngle);
      //Serial.print("\t\t");
      //Serial.print(deltaGyroAngle[0]);
      //Serial.print("\t\t");
      //Serial.print(pitchAccel);
      //Serial.print("\t\t");
      //Serial.print(pitchAngle);
      //Serial.print("\t\t");
      //Serial.println(rollAngle);
      //Serial.println(accVectorMagnitude);
      //Serial.println(pitchAngle);
}
