     delay(1000);
   } while (digitalRead(2));
   Serial.println(F("CONNECTED"));
+  Serial.println(SPACER);
 }
 
 //--------------------------------------------------------------------------------

    BattDiag.Cvolts_max = CellVoltage.maximum(&BattDiag.CV_max_at);
    BattDiag.Cvolts_mean = CellVoltage.mean();
    BattDiag.Cvolts_stdev = CellVoltage.stddev();
    return true;
  } else {
    return false;

   //Wait for start via serial terminal
   WaitforSerial();
   clearSerialBuffer();
   //Serial.println(SPACER);
   delay(500);
   
   //Read CAN-messages 
   int testStep = 0;
   do {
      switch (testStep) {
        case 0:
           Serial.print(F("Reading data."));
           fOK = ReadSOC();
           break;
        case 1:
           fOK = ReadSOCinternal();
           break;
        case 2:
           fOK = ReadPower();
           break;
        case 3:
           fOK = ReadHV();
           break;
        case 4:
           fOK = ReadLV();
           break;
        case 5:
           fOK = ReadODO();
           break;
        case 6:
           fOK = ReadTime();
           break;
      }
      if (testStep < 7) {
        if (fOK) {
          Serial.print(MSG_DOT);
        } else {
          Serial.print(MSG_FAIL);Serial.print(F("#")); Serial.print(testStep);
        }
      }
      testStep++;
   } while (fOK && testStep < 7);
   
   
   //Get diagnostics data
   setCAN_Filter(0x7EF);
  
   testStep = 0;
   do {
      switch (testStep) {
        case 0:
           fOK = getBatteryVoltage(false);
           break;
        case 1:
           fOK = getBatteryCapacity(false);
           break;
        case 2:
           fOK = getBatteryAmps(false);
           break;
        case 3:
           fOK = getBatteryCapInit(false);
           break;
        case 4:
           fOK = getBatteryCapLoss(false);
           break;
        case 5:
           fOK = getBatteryADCref(false);
           break;
        case 6:
           fOK = getBatteryDate(false);
           break;
        case 7:
           fOK = getBatteryTemperature(false);
           break;
        case 8:
           fOK = getHVcontactorState(false); 
           break;
      }
      if (testStep < 9) {
        if (fOK) {
          Serial.print(MSG_DOT);
        } else {
          Serial.print(MSG_FAIL);Serial.print(F("#")); Serial.println(testStep);
        }
      }
      testStep++;
   } while (fOK && testStep < 9);
    
   if (fOK) {
      Serial.println(MSG_OK);
      digitalWrite(CS, HIGH);
      Serial.println(SPACER);
      Serial.print(F("Time [hh:mm]: ")); 
      if (BattDiag.hour < 9) Serial.print(F("0"));
      Serial.print(BattDiag.hour); Serial.print(F(":"));
      if (BattDiag.minutes < 9) Serial.print(F("0"));
      Serial.print(BattDiag.minutes);
      Serial.print(F(",   ODO : ")); Serial.print(BattDiag.ODO); Serial.println(F(" km"));
      Serial.println(SPACER);
      Serial.print(F("Battery-Production [Y/M/D]: ")); Serial.print(2000 + BattDiag.Year); Serial.print(F("/"));
      Serial.print(BattDiag.Month); Serial.print(F("/")); Serial.println(BattDiag.Day);
      Serial.print(F("Initial Capacity : ")); Serial.print(BattDiag.CapInit / 360.0,1); Serial.print(F(" Ah"));
      Serial.print(F(", Loss: ")); Serial.print((float) BattDiag.CapLoss / 1000, 3); Serial.println(F(" %"));
      Serial.println(SPACER);
      Serial.print(F("SOC : ")); Serial.print(BattDiag.SOC,1); Serial.print(F(" %"));
      Serial.print(F(", realSOC: ")); Serial.print((float) BattDiag.realSOC / 10.0, 1); Serial.println(F(" %"));
      Serial.print(F("HV  : ")); Serial.print(BattDiag.HV,1); Serial.print(F(" V, "));
      Serial.print((float) BattDiag.Amps/32.0, 2); Serial.print(F(" A, "));
      Serial.print(((float) (BattDiag.Power / 8192.0) -1) * 300, 2); Serial.println(F(" kW"));
      Serial.print(F("LV  : ")); Serial.print(BattDiag.LV,1); Serial.println(F(" V"));
        
      Serial.println(SPACER);
      Serial.print(F("CV mean : ")); Serial.print(BattDiag.ADCCvolts_mean); Serial.print(F(" mV"));
      Serial.print(F(", dV = ")); Serial.print(BattDiag.ADCCvolts_max - BattDiag.ADCCvolts_min); Serial.println(F(" mV"));
