Quadrature encoder interface library.

Dependents:   NavigationTest_ NavigationTest theRobotNEW theRobot ... more

Fork of QEI by Aaron Berk

Revision:
1:6ae719026b06
Parent:
0:5c2ad81551aa
--- a/QEI.cpp	Thu Sep 02 16:48:55 2010 +0000
+++ b/QEI.cpp	Sat Mar 15 22:36:26 2014 +0000
@@ -251,6 +251,7 @@
                 (prevState_ == 0x0 && currState_ == 0x3)) {
 
             pulses_++;
+            if(pulses_==pulsesPerRev_) revolutions_++;
 
         }
         //10->01->10->01 is clockwise rotation or "backward".
@@ -258,6 +259,7 @@
                  (prevState_ == 0x1 && currState_ == 0x2)) {
 
             pulses_--;
+            if(pulses_==pulsesPerRev_) revolutions_--;
 
         }
 
@@ -274,6 +276,7 @@
             }
 
             pulses_ -= change;
+            
         }
 
     }