   Serial.end();
   isConnected = false;
   disconnectDone = currentMillis;
+  delay(5000); // Wait 5 seconds before reconnecting
   Serial.begin(baudRate);
   serial_rx_buffer_disconnect[0] = 0x0B;
   serial_rx_buffer_disconnect[11] = 0x0B;

void getPong() {
  //  This function gets PONG sent from the computer, then stores it in an Unsigned Long Integer
  pongTimeIn = (unsigned long)serial_rx_buffer_pong_in[5] << 24 | (unsigned long)serial_rx_buffer_pong_in[6] << 16 | (unsigned long)serial_rx_buffer_pong_in[7] << 8 | (unsigned long)serial_rx_buffer_pong_in[8];
  //  This for loop doesn't have to be used, the Arduino doesn't have to respond to PONG with PONG, it doesn't have to respont to PONG at all.
  /*
    for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {
    serial_rx_buffer_ping_out[serial_rx_buffer_counter] = serial_rx_buffer_pong_in[serial_rx_buffer_counter];

  lastPongIn = currentMillis;
  //Serial.flush();
  /*
    Serial.println("PONG RECEIVED");
    Serial.println("");
    Serial.print("CURRENT TIME = ");
    Serial.println(currentMillis);
    Serial.flush();
    Serial.print("LAST PING TIME IN = ");
    Serial.println(lastPingIn);
    Serial.print("LAST PONG TIME IN = ");
    Serial.println(lastPongIn);
    Serial.print("LAST PING TIME OUT = ");
    Serial.println(lastPingOut);
    Serial.print("LAST PONG TIME OUT = ");
    Serial.println(lastPongOut);
    Serial.print("PING TIME OUT = ");
    Serial.println(pingTimeOut);
    Serial.print("PONG TIME OUT = ");
    Serial.println(pongTimeOut);
    Serial.print("PING TIME IN = ");
    Serial.println(pingTimeIn);
    Serial.print("PONG TIME IN= ");
    Serial.println(pongTimeIn);
    Serial.flush();
  */
}

