fork

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
196:f76dbc081e63
Parent:
194:8f3cb37a5541
Child:
197:7a05523bf588
--- a/QEI.c	Tue Sep 20 10:39:30 2016 +0000
+++ b/QEI.c	Fri Sep 23 05:34:50 2016 +0000
@@ -8,7 +8,7 @@
 
 int FFF=0;//для заплатки
 
-int tempdelta;
+
 
 int Pulse_8Point;
 int Pulse_16Point;
@@ -27,7 +27,7 @@
 int Buff_16PointD		[32];
 int Buff_8Point			[32];
 int Buff_Restored_sin 	[32];
-
+int Buff_Restored_sin2 	[32];
 void D_QEI(void)
 {
     Dif_QEI=0;
@@ -68,10 +68,9 @@
         Pulse_16PointD -= Buff_1Point[(CountV255-48) & 0xff];									// 
         Buff_16PointD[CountV31] = Pulse_16PointD ;
      
-    /*Gyro.AmpSC = Gyro.MaxAmp - OldMaxAmp ;
-    if(Gyro.AmpSC<0) Gyro.AmpSC=Gyro.AmpSC*(-1);*/
-//QEIznak;
-        Buff_Restored_sin [CountV31]= (Buff_16PointD[CountV31]) - Buff_32Point[CountV31];
+   
+        Buff_Restored_sin  [CountV31] = (Buff_16PointD[CountV31]) - Buff_32Point[CountV31];
+        Buff_Restored_sin2 [CountV31] = (Buff_16Point[CountV31])  - Buff_32Point[CountV31];
         if((Buff_Restored_sin [CountV31]) > 0)	
         {
         	CaunAddPlus += Buff_Restored_sin  [CountV31]; 
@@ -82,11 +81,14 @@
         	}
         	
         } // счетчик положительных импульсов
-    	else {CaunAddMin	-= Buff_Restored_sin  [CountV31]; Gyro.QEIznak2=1;} //счетчик отрицательных импульсов // расчет амплитуды
-        Gyro.CuruAngle += 	Buff_32Point [CountV31];
+    	else {CaunAddMin -= Buff_Restored_sin  [CountV31]; Gyro.QEIznak2=1;} //счетчик отрицательных импульсов // расчет амплитуды
+    	
+  /*  	
+        Gyro.CuruAngle += Buff_32Point [CountV31];
         Gyro.tempdelta += Buff_Restored_sin[CountV31];
-    	 
+        Gyro.tempdelta2+= Buff_Restored_sin2[CountV31];*/
 }
+/*
 void CurAngle(void)
 {
 	     for (int i = 0; i < 32; i++ ) 
@@ -101,5 +103,5 @@
      WriteCon(Time); 	
      Gyro.CuruAngle=0;
      Gyro.tempdelta=0;
- }
+ }*/
      
\ No newline at end of file