 }
 
 void loop() {
+  Serial.println(status);
   switch (status) {
-    case 1:
-      count--;
-      if (count <= 0) {
+    case 1:      
+      if ((millis() - start_millis) >= delay_millis) {
         status = 3;
       }
       break;
     case 2:
       robot.back();
-      count = 15;
+      delay_millis = 600;
+      start_millis = millis();
       status = 1;
       break;
     case 3:

      status = 0;
      break;
    case 4:
      robot.leftBack();
      robot.rightForward();
      count = 10;
      status = 1;
      break;
  }
}

 - enemy forward;
*/

unsigned long start_millis;
long delay_millis;
long dist;

void setup() {
  pinMode(A0,INPUT);   // set Pin as Input (default)
  pinMode(A1,INPUT);   // set Pin as Input (default)
  PCMSK1 |= bit(0) + bit(1);
  PCIFR  |= bit(1);
  PCICR  |= bit(1);
  status = 2;
}

ISR (PCINT1_vect)
