Skelton of EMG input method program using timer interrupt and thread.

Dependencies:   QEI mbed-rtos mbed

Fork of DCmotor by manabu kosaka

Revision:
2:e056793d6fc5
Parent:
1:b91aeb5673f3
Child:
3:b6b9b8c7dce6
--- a/main.cpp	Thu Nov 15 07:51:42 2012 +0000
+++ b/main.cpp	Thu Nov 15 08:25:43 2012 +0000
@@ -164,8 +164,10 @@
 #ifdef  GOOD_DATA
     if(count2==(int)(TS2/TS)){
 //        j=0; if(_count>=j&&_count<j+1000){i=_count-j;  data[i][0]=_r; data[i][1]=debug[0]; data[i][2]=_y; data[i][3]=_time; data[i][4]=_u;}
-        data[count3][0]=_r; data[count3][1]=debug[0]; data[count3][2]=_y; data[count3][3]=_time; data[count3][4]=_u;
-        count3++;
+        if( count3<1000 ){
+            data[count3][0]=_r; data[count3][1]=debug[0]; data[count3][2]=_y; data[count3][3]=_time; data[count3][4]=_u;
+            count3++;
+        }
         count2 = 0;
     }
     count2++;