  }
  if (millis() >= pingTimer3) {
    pingTimer3 = pingTimer2 + (pingSpeed / 2); // Make sensor 2 fire again 50ms after sensor 1 fires
-   distanceValues[2] = sonar3.ping_cm();
+   // distanceValues[2] = sonar3.ping_cm();
+   distanceValues[2] = readSensor();
    // All three sensors pinged, process results here
    Serial.print("Ping 3: ");
    Serial.print(distanceValues[2]); // Convert ping time to distance and print result (0 = outside set distance range, no ping echo)

//  }
//  Serial.println();
//}
 
//int microsecondsToCentimeters(long microseconds)
//{
//  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
//  // The ping travels out and back, so to find the distance of the
//  // object we take half of the distance travelled.
//  return microseconds / 29 / 2;
//}



#include <NewPing.h>

//Max and Min value for the distance sensor
float maxDistance = 500;
float minDistance = 10;

// # Cable management sensors #
