Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LG2 by
Diff: QEI.c
- Revision:
- 191:40028201ddad
- Parent:
- 190:289514f730ee
- Child:
- 192:d32c8cf7bcd9
--- a/QEI.c Tue Aug 23 14:03:16 2016 +0000
+++ b/QEI.c Mon Aug 29 11:58:52 2016 +0000
@@ -14,8 +14,8 @@
int Pulse_32Point;
int Pulse_64Point;
int Pulse_16PointD;
-int CaunAddPlus =0;//счетчик ипульсов энкодера"+" за такт ВП
-int CaunAddMin =0;//счетчик ипульсов энкодера"-" за такт ВП
+unsigned int CaunAddPlus =0;//счетчик ипульсов энкодера"+" за такт ВП
+unsigned int CaunAddMin =0;//счетчик ипульсов энкодера"-" за такт ВП
int unsigned Cur_QEI, Last_QEI; //текушее и предыдущее,(единичное) значение энкодера
@@ -67,9 +67,8 @@
- Buff_Restored_sin [CountV31]= Buff_16PointD[CountV31] - Buff_32Point[CountV31];
- if((Buff_Restored_sin [CountV31]) > 0) CaunAddPlus += Buff_Restored_sin [CountV31];
+ Buff_Restored_sin [CountV31]= (Buff_16PointD[CountV31]) - Buff_32Point[CountV31];
+ if((Buff_Restored_sin [CountV31]) > 0) CaunAddPlus += Buff_Restored_sin [CountV31];
else CaunAddMin -= (Buff_Restored_sin [CountV31]); // расчет амплитуды
-
Gyro.CuruAngle += Buff_32Point [CountV31];
}
