encoder library

Files at this revision

API Documentation at this revision

Comitter:
YutaTogashi
Date:
Fri Mar 01 05:33:41 2019 +0000
Parent:
0:33005fa67bfd
Commit message:
Encoder

Changed in this revision

Encoder.cpp Show annotated file Show diff for this revision Revisions of this file
Encoder.h Show annotated file Show diff for this revision Revisions of this file
diff -r 33005fa67bfd -r 10ce3d24df8e Encoder.cpp
--- a/Encoder.cpp	Thu Dec 13 08:19:50 2018 +0000
+++ b/Encoder.cpp	Fri Mar 01 05:33:41 2019 +0000
@@ -86,4 +86,8 @@
             return 0;
             break;
     }
+}
+
+void Encoder::reset() {
+    count = 0.0f;
 }
\ No newline at end of file
diff -r 33005fa67bfd -r 10ce3d24df8e Encoder.h
--- a/Encoder.h	Thu Dec 13 08:19:50 2018 +0000
+++ b/Encoder.h	Fri Mar 01 05:33:41 2019 +0000
@@ -25,7 +25,7 @@
         void setup(int Ppr = 400,int Diameter = 0);
         void calculate();
         float getData(short ch);
-        
+        void reset();
     private:
         InterruptIn Apulse;
         InterruptIn Bpulse;