
int delay_time = 10;


// pins 8,9,10,11 for step motor
int stepper0 = 8;
int stepper1 = 9;
int stepper2 = 10;
int stepper3 = 11;



int count;


void setup() {
  // pins set as outputs
  pinMode(stepper0, OUTPUT);
  pinMode(stepper1, OUTPUT);
  pinMode(stepper2, OUTPUT);
  pinMode(stepper3, OUTPUT);
}


void loop() {

  count = 0;
  do {
    // control the direction of step motor to turn counter clockwise
    digitalWrite(stepper0,0); // negative
    digitalWrite(stepper1,1);
    digitalWrite(stepper2,0); // negative
    digitalWrite(stepper3,1);
    delay(delay_time);

    digitalWrite(stepper0,1); // positive
    digitalWrite(stepper1,0);
    digitalWrite(stepper2,0); // negative
    digitalWrite(stepper3,1);
    delay(delay_time);

    digitalWrite(stepper0,1); // positive
    digitalWrite(stepper1,0);
    digitalWrite(stepper2,1); // positive
    digitalWrite(stepper3,0);
    delay(delay_time);

    digitalWrite(stepper0,0); // negative
    digitalWrite(stepper1,1);
    digitalWrite(stepper2,1); // postive
    digitalWrite(stepper3,0);
    delay(delay_time);
    count++;
  } while(count<100);

  count = 0;
  do {
    // control the direction of step motor to turn  clockwise
    digitalWrite(stepper3,0); // negative
    digitalWrite(stepper2,1);
    digitalWrite(stepper1,0); // negative
    digitalWrite(stepper0,1);
    delay(delay_time);

    digitalWrite(stepper3,1); // positive
    digitalWrite(stepper2,0);
    digitalWrite(stepper1,0); // negative
    digitalWrite(stepper0,1);
    delay(delay_time);

    digitalWrite(stepper3,1); // positive
    digitalWrite(stepper2,0);
    digitalWrite(stepper1,1); // positive
    digitalWrite(stepper0,0);
    delay(delay_time);

    digitalWrite(stepper3,0); // negative
    digitalWrite(stepper2,1);
    digitalWrite(stepper1,1); // postive
    digitalWrite(stepper0,0);
    delay(delay_time);

    count++;

  } while(count<100);

}