help with coding for a stepper motor

Thanks Robin2,

i have moved the stepper.run and read through the post you linked to and this tutorial

Below is the altered code, no when i power it up i get no response from the stepper when the pir is triggered.

#include <AccelStepper.h>

AccelStepper stepper (1, 3, 2); // name of stepper motor (1 = driver, pin 3 = step, pin 2 = direction)
int pirPin = 4;

int calibrationTime = 30;
long unsigned int lowIn;
long unsigned int pause = 5000;
boolean lockLow = true;
boolean takeLowTime;
int PIRValue = 0;
long previousMillis = 0;
long interval = 1000;


void setup()
{

  stepper.setMaxSpeed(1000);
  stepper.setAcceleration(200);

  Serial.begin(9600);
  pinMode(pirPin, INPUT);
}


void loop()
{
  PIRSensor();
  stepper.run();
}

void PIRSensor()
{
  if (digitalRead(pirPin) == HIGH)
  {
    if (lockLow)
    {
      stepper.moveTo(100);
      stepper.moveTo(-100);

      PIRValue = 1;
      lockLow = false;
      Serial.println("Motion detected.");

      unsigned long currentMillis = millis();

      if (currentMillis - previousMillis > interval)
        previousMillis = currentMillis;
    }
    takeLowTime = true;
  }

  if (digitalRead(pirPin) == LOW)
  {

    if (takeLowTime) {
      lowIn = millis();
      takeLowTime = false;
    }
    if (!lockLow && millis() - lowIn > pause)
    {
      PIRValue = 0;
      lockLow = true;
      Serial.println("Motion ended.");

      unsigned long currentMillis = millis();

      if (currentMillis - previousMillis > interval)
        previousMillis = currentMillis;
    }

  }
}