ec

Dependents:   F3RC

Fork of EC by ROBOSTEP_LIBRARY

Revision:
26:45a53e3c81b1
Parent:
11:b96009f8b9fd
Child:
32:297384f9d261
diff -r d73c40fd4b55 -r 45a53e3c81b1 EC.cpp
--- a/EC.cpp	Fri Jul 07 09:05:42 2017 +0000
+++ b/EC.cpp	Wed Aug 02 06:55:54 2017 +0000
@@ -77,6 +77,7 @@
     
     if((signalA!=NC)&&(signalB!=NC)){
         S=0;stateA=0;stateB=0;count=0;pre_count=0.0;
+        timer.start();
         signalA_.rise(this,&Ec::upA);
         signalA_.fall(this,&Ec::downA);
         signalB_.rise(this,&Ec::upB);
@@ -84,7 +85,6 @@
     }
     if(signalZ!=NC){
         first=false; rev=0; old_time=0; RPM=0; RPM_old=0;
-        timer.start();
         signalZ_.rise(this,&Ec::upZ);
         signalZ_.fall(this,&Ec::downZ);
     }