QEI library with velocity implementation based on time difference between successive encoder counts.

Dependents:   Bezier_Trajectory_Follower Dolphin 2_131TEST Jerby ... more

Revision:
4:58a3c9c9e956
Parent:
0:43b9eeecccc7
--- a/QEI.h	Tue Aug 11 20:02:03 2015 +0000
+++ b/QEI.h	Wed Sep 23 17:33:09 2015 +0000
@@ -244,10 +244,10 @@
     int          prevState_;
     int          currState_;
     
-    int         currTime_;
-    int         prevTime_;
-    int         currDirection_;
-    int         prevDirection_;
+    volatile int         currTime_;
+    volatile int         prevTime_;
+    volatile int         currDirection_;
+    volatile int         prevDirection_;
     
     Timer timer;