Arduino Uno and Servo motor control

Hi, My friend and I are trying to control 3 LED and 2 Servo motor using Arduino Uno and IR sensor. For LED, we are trying to make each led blink after one minutes (total of three minutes)
After 1 min ->O X X
After 1 min ->O O X
After 1 min ->O O O
Also, the servo motor starts at 0 degree, and when the IR sensor detects an object, the motor turns to 180 degree, wait for 3 minutes and the motor returns to 0 degree. Here is the code we wrote so far.

#include <Servo.h>

Servo servo1, servo2;
int irPin = 7;
int LED1 = 13;
int LED2 = 12;
int LED3 = 11;
int Button = 2;

unsigned long pre_time = 0;
unsigned long now_time = 0;

boolean state = false;

void setup() 
{   
  pinMode(LED1, OUTPUT);  //Timver LED1
  pinMode(LED2, OUTPUT);  //Timer LED2
  pinMode(LED3, OUTPUT);  //Timer LED3
  pinMode(irPin, INPUT);  //IR sensor
  pinMode(Button, INPUT_PULLUP); //Button
  servo1.attach(9);       //Servo1
  servo2.attach(10);      //Servo2

  attachInterrupt(digitalPinToInterrupt(Button), exchange, FALLING);
}

void loop() 
{
  int value = digitalRead(irPin);

  now_time = millis();

  if(value == HIGH)
  {
    if(now_time - pre_time > 100)
    {
      servo1.write(0);
      servo2.write(180);
      pre_time = now_time = 0;
    }

    if(now_time - pre_time > 100)
    {
      digitalWrite(LED1, LOW);
      digitalWrite(LED2, LOW);
      digitalWrite(LED3, LOW);

      pre_time = now_time = 0;
    }
  } 

  if(state = false)
  {
    if(value == LOW)
    {
      if(now_time - pre_time > 100)
      {
        servo1.write(80);
        servo2.write(110);
        pre_time = now_time = 0;
      }

      if(now_time - pre_time > 6000)
      {
        digitalWrite(LED1, HIGH);
        pre_time = now_time = 0;
      }
      if(now_time - pre_time > 6000)
      {
        digitalWrite(LED2, HIGH);
        pre_time = now_time = 0;
      }
      if(now_time - pre_time > 100)
      {
        digitalWrite(LED3, HIGH);
        pre_time = now_time = 0;
      }
      if(now_time - pre_time > 2000)
      {
        servo1.write(0);
        servo2.write(180);
        pre_time = now_time = 0;
      }
    }
  }
}

The problem is we want the motor to stay at 0 degree after three minutes, but the motor go back to 180 degree. How should I modify the code so that after three minutes, motor turns to 0 degree and wait tot trun 180 until the IR sensor detects another object?

Proper use of code tags on your first post. YAY! Karma++

Give me a moment to review your code

Edit:
this bothers me.

   pre_time = now_time = 0;

What are you trying to do?

This bothers me

attachInterrupt(digitalPinToInterrupt(Button), exchange, FALLING);

What do you need an interrupt for?
Where is the handling routine (I think you want one names 'exchange')

Edit2:
You use state, but only initialize it to fals and then never change it.
What are you trying to do with state?

You have 2 independent cycles.

  1. LEDs change every second.
  2. Servos move in response to the IS sensor.
    Right?
    I would think that it would be appropriate to have a different time tracking variable for each.
    It looks to me like you are trying to use pre_time for both.

If I were trying to make this work, I would tackle the 2 pieces separately.
Male the LEDs blink the way you want (further kudos for using millis)
In a different sketch, I would make the sensor and servos work the way I want.
Then I would try to combine them.

Edit3:
You mentioned one second intervals for the LEDs. But I see you using 100 millis. That is only one tenth of a second.

vinceherman:
this bothers me.

   pre_time = now_time = 0;

Google tells me that this is a valid way to set multiple variables.
It still bothers me but that is just a style thing.
Carry on.