Cubic Hand project for EECS 249A course.

Dependencies:   MMA8451Q TSI cc3000_hostdriver_mbedsocket NVIC_set_all_priorities mbed Multi_WS2811

Revision:
36:4a58639da6cf
Parent:
26:42ae7eed0b68
Child:
37:996bd22a633f
--- a/DataGlove.cpp	Thu Dec 11 05:26:39 2014 +0000
+++ b/DataGlove.cpp	Thu Dec 11 07:03:09 2014 +0000
@@ -99,11 +99,6 @@
                 id = (Buf[4] << 8) + Buf[5];
                 pkgtype = Buf[3];
                 ReceiveCount++;
-                if(ReceiveCount > 501 && ReceiveCount%25 == 0) {//printf("%d %c\r\n", ReceiveCount, Buf[0]);
-                	printf("%f %f %f %f %f %f %f %f\r\n", corrected->roll, corrected->pitch, corrected->yaw, 
-                	corrected->fingers[0], corrected->fingers[1], corrected->fingers[2], 
-                	corrected->fingers[3], corrected->fingers[4]);
-                }
                 switch (pkgtype){
                     case STREAM_FINGERS_QUATERNION:
                     {
@@ -144,21 +139,6 @@
                     notConnectedCount++;
             }
         }
-        // Normalize the data for the first 1000 samples
-        /*if (ReceiveCount < 500) {
-        	correction->roll = (correction->roll*ReceiveCount + gl->roll)/(ReceiveCount+1);
-        	correction->pitch = (correction->pitch*ReceiveCount + gl->pitch)/(ReceiveCount+1);
-        	correction->yaw = (correction->yaw*ReceiveCount + gl->yaw)/(ReceiveCount+1);
-        	for (int iter = 0; iter < 5; iter++)
-        		correction->fingers[iter] = (correction->fingers[iter]*ReceiveCount + gl->fingers[iter])/(ReceiveCount+1);
-        }
-        else {
-        	corrected->roll = gl->roll - correction->roll;
-        	corrected->pitch = gl->pitch - correction->pitch;
-        	corrected->yaw = gl->yaw - correction->yaw;
-        	for (int iter = 0; iter < 5; iter++)
-        		corrected->fingers[iter] = gl->fingers[iter] - correction->fingers[iter];
-        }*/
     }
     else {
         //printf("couldn't get data %d\r\n", notConnectedCount);