Home position for steppermotor while powerfailure or at reset.

Hello,

                I’m a newbie on arduino. i want the steppermotor to do the following. Please help me…

  1. power up arduino.
  2. stepper motor at low speed to clockwise.
  3. shaft hits limitswitch.
  4. inputing limitswitch, steppermotor goes anticlockwise a few steps from limitswitch and gets its starting postion.
  5. from this postion, it turns anticlockwise and clockwise and stops at the starting postion without hitting the limit switch.
  6. continues to rotate anticlockwise and clockwise.

It should be on <stepper.h> because the whole project can be driven by 5 volt. (ie, without a4988 driver (12volt).
 I’m using arduino version 1.8.5.
<accelstepper.h> is showing
exit status 1
Error compiling for board Arduino/Genuino Uno.

PLEASE HELP ME ,

I have a code but incomplete ( wrong code) for the above project.

#include <Stepper.h>
const int HomePin=2;  // attach interrupt pin is 0 for arduino uno.
const int stepsPerRevolution = 2200;
const int stepsPerRevolution1 = 1000;   
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
Stepper myStepper1(stepsPerRevolution1, 8, 9, 10, 11);

void setup() {
  pinMode(LedPin,OUTPUT);
  pinMode(HomePin,INPUT_PULLUP);
  myStepper.setSpeed(15);
    myStepper1.setSpeed(10);
 myStepper1.step(-stepsPerRevolution1);
attachInterrupt(0,MainLoop,CHANGE);
}
void MainLoop(){
  digitalWrite(LedPin,HIGH);
delay(500);
digitalWrite(LedPin,LOW);
delay(500);

}
void loop() {
   myStepper.step(stepsPerRevolution);
  delay(50);
  myStepper.step(-stepsPerRevolution);
  delay(50);
}

PLEASE HELP ME…