       status = 0;
       break;
     case 4:
-      robot.leftBack();
-      robot.rightForward();
-      count = 10;
-      status = 1;
+      robot.rightBack();
+      robot.leftForward();
+      delay_millis = 400;
+      start_millis = millis();
+      status = 5;
+      break;
+    case 5:
+      dist = robot.distanceToEnemy();
+      if (((millis() - start_millis) >= delay_millis) || (dist > 5)) {
+        status = 3;
+      }
       break;
   }
 }


MiniRobot robot;

byte status = 2;
/*
0 - don't need changes;
1 - counter only

}

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