ec

Dependents:   F3RC

Fork of EC by ROBOSTEP_LIBRARY

Revision:
7:87c135463de7
Parent:
5:4abba4f54406
Child:
9:a919aa92e65e
diff -r 4abba4f54406 -r 87c135463de7 SpeedController.cpp
--- a/SpeedController.cpp	Sat Nov 12 06:50:56 2016 +0000
+++ b/SpeedController.cpp	Sat Nov 19 07:03:54 2016 +0000
@@ -76,8 +76,8 @@
                 old_speed=now_speed;
                 wait(0.01);
                 now_speed=getRPM();
-                if(now_speed>old_speed) {
-                    if(count>3) break;
+                if(now_speed<old_speed) {
+                    if(count>1) break;
                     else count++;
                 }
             }
@@ -93,8 +93,8 @@
                 old_speed=now_speed;
                 wait(0.01);
                 now_speed=getRPM();
-                if(now_speed<old_speed) {
-                    if(count>3) break;
+                if(now_speed>old_speed) {
+                    if(count>1) break;
                     else count++;
                 }
             }