running the stepper motor using interrupts

i am trying to run the 2 stepper motor , motor1 should run in clockwise other motor2 should run in boht the directions. im trying to run the motor using interrupts. but i coulnt control the motor . my application is for transformer winding machine . i should control the number of windings and number of turns, my idea is to control the 2 motors simultaneously like… 1 motor should keep rotate in 1 direction i.e motor shaft is connected to transformer bobbin ,other motor rotate in both direction to which copper reel is fixed, i want to control both the motor rotation as per my requirement. can anyone suggest me??? thanks in advance

Here is my code

#include <TimerOne.h>


int motor1Pin1 = 8;
int motor1Pin2 = 9;
int motor1Pin3 = 10;
int motor1Pin4 = 11;
int motor2Pin1 = 4;
int motor2Pin2 = 5;
int motor2Pin3 = 6;
int motor2Pin4 = 7;
int delayTime = 50;
int n;
float Step1=50;
float Step2=50;
int rotation1=45;
int rotation2=45;


void setup() 
{
// put your setup code here, to run once:
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
pinMode(motor1Pin3, OUTPUT);
pinMode(motor1Pin4, OUTPUT);   
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
pinMode(motor2Pin3, OUTPUT);
pinMode(motor2Pin4, OUTPUT);             
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor1Pin3, LOW);
digitalWrite(motor1Pin4, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, LOW);
 Timer1.initialize(); 

}

void loop()
{
// put your main code here, to run repeatedly:

for(n=0; n<=rotation1; n++)
{
for(n=0; n<=Step1; n++)
{

 ForwardMotor1();

}
 Timer1.initialize(1000); 
 Timer1.attachInterrupt(BackwardMotor2); 
}

for(n=0; n<=rotation2; n++)
{
for(n=0; n<=Step1; n++)
{

 ForwardMotor1();

}
 Timer1.initialize(1000); 
 Timer1.attachInterrupt(ForwardMotor2);   

}

}






void ForwardMotor1()
{
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor1Pin3, LOW);
digitalWrite(motor1Pin4, LOW);
delay(delayTime);
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, HIGH);
digitalWrite(motor1Pin3, LOW);
digitalWrite(motor1Pin4, LOW);
delay(delayTime);
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor1Pin3, HIGH);
digitalWrite(motor1Pin4, LOW);
delay(delayTime);
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor1Pin3, LOW);
digitalWrite(motor1Pin4, HIGH);
delay(delayTime);
}




void ForwardMotor2()
{
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, HIGH);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, HIGH);
delay(delayTime);
}

void BackwardMotor2()
  {
    
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, HIGH);
delay(delayTime);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, HIGH);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
digitalWrite(motor2Pin3, LOW);
digitalWrite(motor2Pin4, LOW);
delay(delayTime);
    
  }


void StopMotor()
{
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor1Pin3, LOW);
digitalWrite(motor1Pin4, LOW);
delay(delayTime);
}

Please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum Your code is too long for me to study quickly without copying to a text editor.

Post a link to the datasheet for your stepper motors.
Tell us what stepper motor drivers you are using.

…R
Stepper Motor Basics
Simple Stepper Code

You are trying to call delay() from within an interrupt routine. This locks up the whole system.

Interrupts should do as little as possible and exit immediately. Calls to delay() and Serial will not work in such a context.

For stepper motor driving the interrupt routine ought to be doing something more like "is it time yet to step one of the motors? if so step it"

Where step means one step without any delaying. Call micros() and examine some variables to make the decision.