Interface to a standard tarco sensor. Measure the periode and the cal the speed

Revision:
5:451dd1189b0f
Parent:
4:35024179a736
Child:
6:2ad5029f7b1a
--- a/Tarco.h	Tue Nov 19 09:19:01 2013 +0000
+++ b/Tarco.h	Tue Nov 19 12:44:26 2013 +0000
@@ -2,7 +2,7 @@
 
 #ifndef _Tarco_H
 #define _Tarco_H
-
+#define TarcoRunMean 50
 
 class Tarco {
 
@@ -11,11 +11,12 @@
     void click(); //Measure the tarco from a one puls /rotation source
     void fsk();   //measure tarco from a fsk source
     int p1,p2;
-    int AdvPeriode;
+    int AdvPeriode[TarcoRunMean]; //running mean for tarco
     Timer t; //time for one rotation
     Timer fsktime; //time between fsk pulse
     int pulsvariation, lastpuls, count;
     char tarcomode;
+    float lastfrekvens;
 public:
     // ********************************************************************************
     // Constructor