From d3912b6ec928bf12c90ae0ea0c4b85e088474f6b Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Sun, 2 Jul 2023 11:33:38 -0500 Subject: [PATCH] Update Stepper.md --- docs/Stepper.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/Stepper.md b/docs/Stepper.md index 7091c18..fcbe6a7 100644 --- a/docs/Stepper.md +++ b/docs/Stepper.md @@ -184,7 +184,7 @@ If neither of the above motor driver classes works for your specific chip or dri * `void onEnable()` - contains the logic that enables the motor driver * `void onDisable()` - contains the logic that disables the motor driver * `void onBrake()` - contains the logic that puts the motor into a short brake state -* `void setStepType(int mode)` - contains the logic to set the step type mode based on the *mode* parameter +* `StepperControl *setStepType(int mode)` - contains the logic to set the step type mode based on the *mode* parameter Only the first method, `onStep()`, is required to be defined. You can leave any of the other methods undefined if they are not applicable for your specific driver board. You can of course create additional methods to reflect any other features your driver board may support. @@ -223,7 +223,7 @@ struct Stepper_A3967 : StepperControl { ////////////////////////// - void onStep(boolean direction){ + void onStep(boolean direction) override { digitalWrite(dirPin,direction); digitalWrite(stepPin,HIGH); digitalWrite(stepPin,LOW); @@ -243,7 +243,7 @@ struct Stepper_A3967 : StepperControl { ////////////////////////// - void setStepType(int mode) override { + StepperControl *setStepType(int mode) override { switch(mode){ case FULL_STEP_TWO_PHASE: digitalWrite(m1Pin,LOW); @@ -264,6 +264,7 @@ struct Stepper_A3967 : StepperControl { default: ESP_LOGE(STEPPER_TAG,"Unknown StepType=%d",mode); } + return(this); } };