Added [override] to onStep

This commit is contained in:
Gregg 2023-07-02 11:39:31 -05:00
parent d3912b6ec9
commit 9a42f0885c
3 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ struct Stepper_A3967 : StepperControl {
////////////////////////// //////////////////////////
void onStep(boolean direction){ void onStep(boolean direction) override {
digitalWrite(dirPin,direction); digitalWrite(dirPin,direction);
digitalWrite(stepPin,HIGH); digitalWrite(stepPin,HIGH);
digitalWrite(stepPin,LOW); digitalWrite(stepPin,LOW);

View File

@ -109,7 +109,7 @@ struct Stepper_TB6612 : StepperControl {
////////////////////////// //////////////////////////
void onStep(boolean direction){ void onStep(boolean direction) override {
if(direction) if(direction)
phase=(phase+1)%nPhases; phase=(phase+1)%nPhases;
else else

View File

@ -45,7 +45,7 @@ void setup() {
delay(1000); delay(1000);
Serial.printf("\nHomeSpan Stepper Control\n\n"); Serial.printf("\nHomeSpan Stepper Control\n\n");
bigMotor=(new Stepper_TB6612(23,32,22,14,33,27))->setStepType(StepperControl::HALF_STEP)->setAccel(10,20);; bigMotor=(new Stepper_TB6612(23,32,22,14,33,27))->setStepType(StepperControl::HALF_STEP)->setAccel(10,20);
smallMotor=new Stepper_A3967(17,16,19,18,21); smallMotor=new Stepper_A3967(17,16,19,18,21);
// bigMotor->setStepType(StepperControl::HALF_STEP); // bigMotor->setStepType(StepperControl::HALF_STEP);