From 202bf5462351770c790479830cf9a1c05a654f36 Mon Sep 17 00:00:00 2001 From: Tamir Rosenberg <68561398+tamirrosenberg@users.noreply.github.com> Date: Mon, 5 Jul 2021 09:15:29 -0700 Subject: [PATCH] Update N6JJ_WiFi_Stepper_Motor_Controller.ino 1. Updated the "FineTune" Delays and Rotation to be more accurate 2. Replaced "Steps" with "Delay" - It will be more clear to understand 3. Fix typo in a comment --- N6JJ_WiFi_Stepper_Motor_Controller.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/N6JJ_WiFi_Stepper_Motor_Controller.ino b/N6JJ_WiFi_Stepper_Motor_Controller.ino index 553bb05..dd8690f 100644 --- a/N6JJ_WiFi_Stepper_Motor_Controller.ino +++ b/N6JJ_WiFi_Stepper_Motor_Controller.ino @@ -94,15 +94,15 @@ BLYNK_WRITE(V4){ // Blynk virtual pin V4 // -- Main Tunning Function --------------------------------------------------------------------------------- -void Tunning (int Steps, int Rotation){ +void Tunning (int Delay, int Rotation){ digitalWrite(enablePin, LOW); // enable the driver for (int i = 0; i < Rotation; i++){ // loop for motor steps digitalWrite(stepPin, HIGH); // perform a step digitalWrite(LED_BUILTIN, LOW); // turn LED indicator OFF - delayMicroseconds(Steps); // wait for the steps operation + delayMicroseconds(Delay); // wait for the steps operation digitalWrite(stepPin, LOW); // stop the step - digitalWrite(LED_BUILTIN, HIGH); // tuen LED indicator ON - delayMicroseconds(Steps); // wait between steps + digitalWrite(LED_BUILTIN, HIGH); // tune LED indicator ON + delayMicroseconds(Delay); // wait between steps Blynk.run(); } } @@ -122,7 +122,7 @@ void loop() { if (FineTuneRight){ // fine turn right digitalWrite(dirPin, LOW); // set direction to one side - Tunning(3000, 16); // turn slow, aka "Fine Tune" + Tunning(10000, 1); // turn slow, aka "Fine Tune" } if (TuneLeft){ // turn left @@ -132,7 +132,7 @@ void loop() { if (FineTuneLeft){ // fine turn left digitalWrite(dirPin, HIGH); // set direction to the other side - Tunning(3000, 16); // turn slow, aka "Fine Tune" + Tunning(10000, 1); // turn slow, aka "Fine Tune" } while (Scan) { // scan as long as the App button is enable