From 02e8b13283750e6013d4e6e1e8d2f251fbffd2e7 Mon Sep 17 00:00:00 2001 From: Agis Zisimatos Date: Sat, 19 Apr 2014 19:11:59 +0300 Subject: [PATCH] Stepper.ino --- arduino/Stepper.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arduino/Stepper.ino b/arduino/Stepper.ino index 989cba9..ab53ff9 100644 --- a/arduino/Stepper.ino +++ b/arduino/Stepper.ino @@ -4,7 +4,7 @@ void stepper_move() { digitalWrite(DIR_AZ, HIGH); digitalWrite(STEP_AZ, HIGH); - stepPosAz++; + stepPosAz++; stepAz--; } else if(stepAz<0) @@ -14,6 +14,10 @@ void stepper_move() stepPosAz--; stepAz++; } + if (stepPosAz > SPD*60) + stepPosAz = 0; + else if (stepPosAz < 0) + stepPosAz = SPD*60; if(stepEl>0) { -- GitLab