Hello,
I am ironing out an attempted improvement to my existing code. I have two stepper motors that ultimately move two bars in or out that are attached to a linkage between the ends.
Rough sketch:
Currently, I have this:
while (!digitalRead(LIMIT_PIN_1)) {stepper1.setSpeed(1000); stepper1.run();} // Negative speed for reverse direction
while (!digitalRead(LIMIT_PIN_2)) {stepper2.setSpeed(1000); stepper2.run();} // Negative speed for reverse direction
And it works, but if the bars are too far out, it will cause a mechanical failure due to how it is mounted, the bar needs to be "horizontal" during operation. In the bigger picture, I want to zero each motor individually before assigning them to a MultiStepper grouping for the rest of the program.
So I tried to write this:
while ((!digitalRead(LIMIT_PIN_1))||(!digitalRead(LIMIT_PIN_3))){
if (!digitalRead(LIMIT_PIN_1)) {stepper1.setSpeed(1000); stepper1.run();} // Negative speed for reverse direction
if (!digitalRead(LIMIT_PIN_2)) {stepper2.setSpeed(1000); stepper2.run();} // Negative speed for reverse direction
}
It compiles fine, but I get no movement in the steppers. No other changes were made. Is there a limit to AccelStepper that I don't know of in this reguard?