void Diagscan () {
  byte error, address;
  int nDevices;
  tft.setCursor(25, 80);
  
  if (i2cScan == 0) {
    nDevices = 0;
    for (address = 1; address < 127; address++ )
    {
      // The i2c_scanner uses the return value of
      // the Write.endTransmisstion to see if
      // a device did acknowledge to the address.
      Wire.beginTransmission(address);
      error = Wire.endTransmission();
      if (error == 0)
      {
        tft.setTextColor(ILI9341_CYAN, ILI9341_BLACK);
        tft.setTextSize(1);
        tft.print("I2C device at 0x");
        if (address < 16)
          tft.print("0");
        tft.print(address, HEX); tft.println(", ");
        DevCount == (DevCount + 9);
        nDevices++;
      }
      else if (error == 4)
      {
        tft.setCursor(25, 80);
        tft.setTextColor(ILI9341_CYAN, ILI9341_BLACK);
        tft.print("Unknow error at address 0x");
        if (address < 16)
          tft.print("0");
        tft.println(address, HEX);
      }
    }

    //-------------------------------------i2c Scan------------------------------------------------
    tft.setCursor(25, 155);
    tft.setTextColor(ILI9341_PINK, ILI9341_BLACK);
    tft.setTextSize(1);
//    if (!bme.begin()) {
//      tft.println("No BME280 (ATM) found, ");
//    }
    if (!tsl.begin()) {
      tft.println("No TSL2561 (LUX) found, ");
    }
    //if(!accel.begin()){tft.println("No LSM303 (DOF9a) found, ");}
    //if(!mag.begin()){tft.println("No LSM303 (DOF9b) found, ");}
    //if(!gyro.begin()){tft.println("No L3GD20 (DOF9c) found, ");}
    if (!uv.begin()) {
      tft.println("No Si1145 (UV,IR,VIS) found, ");
    }
    if (!tcs.begin()) {
      tft.println("No TCS34725 (COLOR) found, ");
    }
    if (!mlx.begin()) {
      tft.println("No MLX90614 (IR-Temp) found, ");
    }

    i2cScan = 1;

    //-------------------------SD Card---------------------------------------------------------------
    /*
    if (!card.init(SPI_HALF_SPEED, chipSelect)) {
      tft.setCursor(25, 180);
      tft.setTextColor(ILI9341_ORANGE, ILI9341_BLACK);
      tft.setTextSize(1);
      tft.print("No SD Card found!");
    } else {
      tft.setCursor(25, 180);
      tft.setTextColor(ILI9341_ORANGE, ILI9341_BLACK);
      tft.setTextSize(1);
      tft.print("SD [Type: ");
      switch (card.type()) {
        case SD_CARD_TYPE_SD1: tft.print("SD1, "); break;
        case SD_CARD_TYPE_SD2: tft.print("SD2, "); break;
        case SD_CARD_TYPE_SDHC: tft.print("SDHC, "); break;
        default: tft.print("Unknown, ");
      }
      if (!volume.init(card)) {
        tft.print("No Part (ntfs/xfs?), ");
      }
      // print the type and size of the first FAT-type volume
      uint32_t volumesize;
      volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
      volumesize *= volume.clusterCount();       // we'll have a lot of clusters
      volumesize /= 2;                           // SD card blocks are always 512 bytes (2 blocks are 1KB)
      tft.print("Size (Mb): ");
      volumesize /= 1024;
      tft.print(volumesize);
      tft.print("]");
    }
    */

    tft.setTextColor(ILI9341_PINK, ILI9341_BLACK); tft.setCursor(25, 170);

    if (nDevices == 0) {
      tft.print("No I2C devices found\n"); tft.print("No I2C devices found\n");
    } else {
      tft.print("Done");
      tft.print(", all i2c Modules Found");
    }

    //------------------------------RTC Check------------------------------------------------------------
    if (RTCFail == 1) {
      tft.setCursor(25, 70);
      tft.setTextColor(ILI9341_PINK, ILI9341_BLACK);
      tft.setTextSize(1);
      tft.print("RTF Batt Failure, ReFlash to reset RTC!");
    }
  }
}
