I want to drive two steppers with the same arduino, I made the circuit on a breadboard with 2 L293 and this program:
#include <Stepper.h>
#define STEPS 400
Stepper stepper1(STEPS, 2, 3, 4, 5);
Stepper stepper2(STEPS, 8, 9, 10, 11);
int ledPin = 13;
void setup()
{
// set the speed of the motor to 60 RPMs
stepper1.setSpeed(60);
stepper2.setSpeed(60);
blink(3);
}
void loop()
{
stepper1.step(2000);
stepper2.step(1000);
delay (5000);
stepper1.step(-2000);
stepper2.step(2000);
delay (5000);
}
// Blink the reset LED:
void blink(int howManyTimes) {
int i;
for (i=0; i< howManyTimes; i++) {
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
}
}
The two steppers are working, but sequencialy, not together. Someone know if it is possible to have it or not?
Yhank you