I am making a simple clock, I am 3d printing most of the parts needed. I am not very good at programing but need to have two motors running at the same time at different speeds. As of now I can get both of them to move but they switch off turning. Can anyone help me get both of them to move at the same time?
#include <Stepper.h>
#define STEPS_PER_MOTOR_REVOLUTION 32
#define STEPS_PER_OUTPUT_REVOLUTION 32 * 64 //2048
Stepper smal_stepper(STEPS_PER_MOTOR_REVOLUTION, 4, 5, 6, 7);
Stepper small_stepper(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11);
int Steps2Take;
void setup() {
Steps2Take = STEPS_PER_OUTPUT_REVOLUTION / 2; // Rotate CW 1/2 turn
small_stepper.setSpeed(100);
small_stepper.step(Steps2Take);
delay(0);
}
void loop() {
// put your main code here, to run repeatedly:
Steps2Take = STEPS_PER_OUTPUT_REVOLUTION / 2; // Rotate CW 1/2 turn
smal_stepper.setSpeed(100);
smal_stepper.step(Steps2Take);
delay(0);
}