 
 int distance, distance2;
 
-bool sensor1Activated = false, sensor2Activated = false;
+bool sensor1Activated = false, sensor2Activated = false, secondChecked = false;
 
 int countIncoming = 0, countOutgoing = 0;
-
-const long interval = 250;
-unsigned long previousMillis = 0;
 
 ESP8266WebServer server(80);
 


  while(sensor1Activated == true && sensor2Activated == false){
    server.handleClient();
    if(getDistanceFromSensor(trigPin2, echoPin2) <= 15){
      Serial.println("ENTERED");
      sensor1Activated = false;
      sensor2Activated = false;
      countIncoming += 1;
      delay(250);
      break;
    }
  }

  while(sensor2Activated == true && sensor1Activated == false){
    server.handleClient();
    if(getDistanceFromSensor(trigPin, echoPin) <= 15){
      Serial.println("EXITING");
      sensor1Activated = false;
      sensor2Activated = false;
      countOutgoing += 1;
      delay(250);
      break;
    }
  }

#include <WiFiClient.h> 
#include <ESP8266WebServer.h>

const char *ssid = "ConTrolley";
const char *password = "makeawok";

const int trigPin = 5;
const int echoPin = 4;
