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
main
Tamir Rosenberg 2021-07-05 09:15:29 -07:00 zatwierdzone przez GitHub
rodzic 9c7f2ad3f4
commit 202bf54623
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -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