pause data acquisition

example: when my robot i s near an obstacle the proximity sensors give a value and then arduino sent a series of commands to the motors for 8-10 seconds. During this time of 8-10 seconds I need to pause the acquisition from sensors. How can I do?

Can someone give me a suggestion?

many thanks in advance!

arduino sent a series of commands to the motors for 8-10 seconds.

How?

During this time of 8-10 seconds I need to pause the acquisition from sensors.

Why? You want the robot to run into something?

How can I do?

Depends on how you are currently doing things.

Can someone give me a suggestion?

I suggest that you post your code.

I try to explain better.

I posted below the code, when the LDR sensor find the obstacle it starts a three step routine ( motors stop for 2 second, then motors back for 4 seconds, then turn for 4 seconds)

int photocellPin = 0;
int photocellReading; 
int motor1Pin1 = 3;                             // pin 2 on L293D
int motor1Pin2 = 4;                             // pin 7 on L293D
int led_stop = 11;
int enable1Pin = 9;                             // pin 1 on L293D
int motor2Pin1 = 5;                             // pin 10 on L293D
int motor2Pin2 = 6;                             // pin  15 on L293D
int enable2Pin = 10;


void setup() {
  Serial.begin(9600);
 pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(enable1Pin, OUTPUT);
  pinMode(led_stop, OUTPUT);
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);
  pinMode(enable2Pin, OUTPUT);
}

void loop() {
  photocellReading = analogRead(photocellPin);
  if ( photocellReading < 100)
  {
  wait();
  delay (2000);
  back();
  delay (4000);
  turn();
  delay(4000);
   digitalWrite(led_stop, LOW);
   }
   if ( photocellReading > 100)
   {
   forward();
   }
}

void turn(){
   digitalWrite(enable1Pin, HIGH);
  digitalWrite(motor1Pin1, HIGH);
    digitalWrite(motor1Pin2, LOW);
    digitalWrite(motor2Pin1, LOW);
    digitalWrite(motor2Pin2, HIGH);
    Serial.println("TURN");
}

void forward(){
  digitalWrite(enable1Pin, HIGH);
  digitalWrite(motor1Pin1, HIGH);
    digitalWrite(motor1Pin2, LOW);
    digitalWrite(motor2Pin1, HIGH);
    digitalWrite(motor2Pin2, LOW);
    Serial.println("FORWARD ");
}

void back(){
  digitalWrite(enable1Pin, HIGH);
  digitalWrite(motor1Pin1, LOW);
    digitalWrite(motor1Pin2, HIGH);
    digitalWrite(motor2Pin1, LOW);
    digitalWrite(motor2Pin2, HIGH);
    Serial.println("BACK ");
}

void wait(){
  digitalWrite(motor1Pin1, LOW);
    digitalWrite(motor1Pin2, LOW);
    digitalWrite(motor2Pin1, LOW);
    digitalWrite(motor2Pin2, LOW);
     digitalWrite(led_stop, HIGH);
    Serial.println("STOP ");
}

wait() takes hardly any time at all to execute. delay(2000) means sit on your hands and do absolutely nothing (except respond to interrupts) for 2 seconds.

back() takes hardly any time at all to execute. delay(4000) means sit on your hands and do absolutely nothing (except respond to interrupts) for 4 seconds.

turn() takes hardly any time at all to execute. delay(4000) means sit on your hands and do absolutely nothing (except respond to interrupts) for 4 seconds.

The wait(), back(), and turn() functions do not perform any sensor data acquisition. The delay() doesn't either. It does nothing.

So, it seems that you have already addressed the "During this time of 8-10 seconds I need to pause the acquisition from sensors." requirement.

Most people want to do it the other way - delay() but still collect data.

ok I' ll try the code as soon as I resolve a problem with the motor driver circuit. thanks