-// UNCOMMENT ONE OF THE TWO OPTIONS BELOW
+// UNCOMMENT ONE OF THE FOUR OPTIONS BELOW
 
 //#define PRINTDATA // uncomment to display raw data over serial port in format [gX     gY     gZ      aX      aY      aZ]
-#define SAMPLERATE // uncomment to display sampling rate over serial port updates every 2 seconds with sampleing rate in Hz
+//#define PRINTANGLE // identical to PRINTDATA but gyro data is in delta degrees [gX     gY     gZ      aX      aY      aZ]
+//#define PRINTANGLESUM // uncomment to display simple intigration of gyro over X axis in degrees
+//#define SAMPLERATE // uncomment to display max sampling rate over serial port updates every 2 seconds with sampleing rate in Hz
 
 #include <avr/eeprom.h>
 

static uint16_t calibratingA = 0;  // the calibration is done in the main loop. Calibrating decreases at each cycle down to 0, then we enter in a normal mode.
static int16_t  acc_25deg;


// ************************************************************************************************************
// Main Program

}

void loop()
{	    	
	ACC_getADC();
	Gyro_getADC();
	#if (defined(PRINTANGLE) || defined(PRINTANGLESUM))
		static uint16_t previousT;
 		uint16_t currentT = micros();
 		float scale, deltaGyroAngle[3];
 		float static angleSum[3];
 		byte axis = 0;

 		scale = (currentT - previousT) * GYRO_SCALE;
 		previousT = currentT;

 		for (axis = 0; axis < 3; axis++){
    		deltaGyroAngle[axis] = gyroADC[axis]  * scale * RADTODEG;
    	}

    #if defined(PRINTANGLESUM)
    	angleSum[0] += deltaGyroAngle[0];
    	if(Serial.available() > 0)
    	{
    		angleSum[0] = 0;
    		Serial.read();
    	}
    	Serial.println(angleSum[0]);
   	#endif

   	#if defined(PRINTANGLE)
    	printAngleData(deltaGyroAngle);
    #endif

    	delayMicroseconds(650); // emperical delay between readings 

	#endif
	#if defined(PRINTDATA) 
		printRawData();
	#elif defined(SAMPLERATE)
