New QEI library with position (angle) outputs

Fork of QEI_modified by Chun Feng Huang

Revision:
2:205d0280632a
Parent:
1:894673d52596
Child:
4:9699a757d4ed
--- a/QEI.h	Mon Feb 22 09:02:41 2016 +0000
+++ b/QEI.h	Mon Feb 22 09:44:15 2016 +0000
@@ -150,8 +150,10 @@
     volatile int pulses_;
     
     int angularvelocity;
-    int countArray[50];
+    int *countArray;
     uint8_t arrayPtr;
+    int arraysize_;
+    double sampletime_;
 
     typedef enum Encoding {
 
@@ -182,7 +184,7 @@
      *                 of only channel A where as X4 uses them on both
      *                 channels.
      */
-    QEI(PinName channelA, PinName channelB, PinName index, int pulsesPerRev, Encoding encoding = X2_ENCODING);
+    QEI(PinName channelA, PinName channelB, PinName index, int pulsesPerRev, int arraysize, double sampletime, Encoding encoding = X2_ENCODING);
 
     /**
      * Reset the encoder.