Tachometer library

Dependents:   ES202_FinalProject_workingExample DREAMTEAM

Fork of Tach by John Donnal

Files at this revision

API Documentation at this revision

Comitter:
lddevrie
Date:
Wed Apr 18 17:11:54 2018 +0000
Parent:
0:c165325c9e3f
Commit message:
test

Changed in this revision

Tach.cpp Show annotated file Show diff for this revision Revisions of this file
Tach.h Show annotated file Show diff for this revision Revisions of this file
--- a/Tach.cpp	Fri Mar 02 16:52:58 2018 +0000
+++ b/Tach.cpp	Wed Apr 18 17:11:54 2018 +0000
@@ -31,7 +31,7 @@
     float speed;
     static int i=0;
     count_++;
-    speed =  1.0/(timer_.read()*pulsesPerRev_);
+    speed =  1.0/(timer_.read()*pulsesPerRev_); // in Hz, i.e. rev/s
     speedBuffer_[i%NSAMP]=speed;
     i++;
     timer_.reset();
--- a/Tach.h	Fri Mar 02 16:52:58 2018 +0000
+++ b/Tach.h	Wed Apr 18 17:11:54 2018 +0000
@@ -14,7 +14,7 @@
 /**
  * Defines
  */
-#define NSAMP 3
+#define NSAMP 5
 
 /**
  * Tach Interface.