summaryrefslogtreecommitdiffstats
path: root/linz/glasslathe/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linz/glasslathe/src/main.cpp')
-rw-r--r--linz/glasslathe/src/main.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/linz/glasslathe/src/main.cpp b/linz/glasslathe/src/main.cpp
index ee1e8d4..801d02e 100644
--- a/linz/glasslathe/src/main.cpp
+++ b/linz/glasslathe/src/main.cpp
@@ -80,7 +80,7 @@ void loop()
80 Serial.println(target.frequency, DEC); 80 Serial.println(target.frequency, DEC);
81 } 81 }
82 82
83 const int step_delay = 300; 83 const int step_delay = 200;
84 if (current.frequency != target.frequency || current.direction != target.direction) 84 if (current.frequency != target.frequency || current.direction != target.direction)
85 { 85 {
86 if (!timer_enabled && target.frequency != 0) 86 if (!timer_enabled && target.frequency != 0)
@@ -91,18 +91,12 @@ void loop()
91 delay(step_delay); 91 delay(step_delay);
92 } 92 }
93 93
94 /*int step = (current.potValue < 20) ? 1 94 int step = (current.frequency > 5000) ? 100
95 : (current.potValue < 100) ? 2 95 : (current.frequency > 4000) ? 100
96 : (current.potValue < 300) ? 3 96 : (current.frequency > 3000) ? 150
97 : (current.potValue < 400) ? 5 97 : (current.frequency > 2000) ? 150
98 : (current.potValue < 500) ? 10 98 : (current.frequency > 1000) ? 120
99 : 20;*/ 99 : 200;
100 int step = (current.frequency > 5000) ? 1
101 : (current.frequency > 4500) ? 2
102 : (current.frequency > 4000) ? 5
103 : (current.frequency > 3000) ? 10
104 : (current.frequency > 1000) ? 25
105 : 50;
106 int frequency = (current.direction == target.direction) ? target.frequency : 0; 100 int frequency = (current.direction == target.direction) ? target.frequency : 0;
107 step = min(abs(frequency - current.frequency), step); 101 step = min(abs(frequency - current.frequency), step);
108 if (frequency < current.frequency) 102 if (frequency < current.frequency)