hello everybody
first i am sorry about my poor english., i am just start with the arduino and the stepper, and i am lost ...
i want to do the following
stepper 1 and stepper 2 move at the same time to ( lets say , position 10000)
this i could do with the accelstepper example.. but now i want the steppers to stay for 1 sec. , than stapper 1
should move to position 5000 after another delay stepper 2 should move as well.,
now ( for example ) i want again that they move together ...
if i start with the delay ... everythig stops ( move only step by step)
i did a code were the steppers are moving , but only one by one... but 2 or 3 moves they shoud do
together .,
i hope somebody can help, would be wery nice
thx in advance
</>
#include <AccelStepper.h>
#define STEPPER1_DIR_PIN 3
#define STEPPER1_STEP_PIN 2
#define STEPPER2_DIR_PIN 7
#define STEPPER2_STEP_PIN 6
#define STEPPER3_DIR_PIN 8
#define STEPPER3_STEP_PIN 9
AccelStepper stepper1(AccelStepper::DRIVER, STEPPER1_STEP_PIN, STEPPER1_DIR_PIN);
AccelStepper stepper2(AccelStepper::DRIVER, STEPPER2_STEP_PIN, STEPPER2_DIR_PIN);
AccelStepper stepper3(AccelStepper::DRIVER, STEPPER3_STEP_PIN, STEPPER3_DIR_PIN);
void setup()
{
stepper1.setMaxSpeed(2300.0);
stepper1.setAcceleration(300.0);
stepper2.setMaxSpeed(2300.0);
stepper2.setAcceleration(300.0);
stepper3.setMaxSpeed(500.0);
stepper3.setAcceleration(80.0);
}
void loop()
{
{
stepper1.runToNewPosition(62000);
stepper2.runToNewPosition(80000);
delay(0);
stepper1.runToNewPosition(20000);
stepper2.runToNewPosition(45000);
delay(1000);
}
{
{
stepper3.runToNewPosition(4000);
}
stepper1.runToNewPosition(10000);
delay(1500);
stepper2.runToNewPosition(80000);
delay(1500);
}
stepper1.runToNewPosition(0);
stepper2.runToNewPosition(0);
while(1) { }
}
</>