//---------------------------------------------DRAW SCANMODE-------------------------------------------------------------------------------------------------
void DrawScanmode(){
myStats1.clear();
myStats2.clear();
  tft.setCursor(34,34);
  tft.setTextSize(3);
  int RadStart = 0;
if (AltMode == 0){
  if (ScanMode == 5){  //----------------------------------------------------------LUM------------------------------
    leds[1] = CRGB(35,50,65); FastLED.show(); //Status LED White
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    tft.print("Scan Mode: LUM ");
    tft.setTextSize(2);tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    tft.setCursor(25,95);tft.print("    LUX: ");
    tft.setCursor(25,115);tft.print("    VIS: ");
    tft.setCursor(25,135);tft.print("     IR: ");
    tft.setCursor(25,155);tft.print("     UV: ");
    tft.setCursor(25,175);tft.print("UVIndex: ");
    tft.drawRect( (gridStartX -2), (gridStartY -2), ((pixelWidth*8)+4), ((pixelHeight*8)+4), ILI9341_WHITE); //grideye display frame
    tft.setCursor(225,195);tft.setTextSize(1);tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK); tft.print("Col (");
    tft.setTextSize(1);
    tft.setTextColor(ILI9341_RED, ILI9341_BLACK);tft.print("R");
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);tft.print(",");
    tft.setTextColor(ILI9341_BLUE, ILI9341_BLACK);tft.print("B");
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);tft.print(",");
    tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);tft.print("G");
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);tft.print("):");
  }
  else if (ScanMode == 1){ //------------------------------------------------------ATM--------------------------------
    leds[1] = CRGB(5,40,70); FastLED.show(); //Cyan
    tft.setTextColor(ILI9341_CYAN, ILI9341_BLACK);
    tft.print("Scan Mode: ATM ");
    //myStats.clear();
      tft.setTextSize(2);tft.setTextColor(ILI9341_CYAN, ILI9341_BLACK);
      //tft.setCursor(25,115);tft.print("GRID Max: ");
      //tft.setCursor(25,135);tft.print("GRID Avg: ");
      tft.setCursor(25,95);tft.print("Target A: ");
      tft.setCursor(25,115);tft.print("Target D: ");
      tft.setCursor(25,135);tft.print("Temp Avg: ");
      tft.setCursor(25,155);tft.print("Pressure: ");
      tft.setCursor(25,175);tft.print("Altitude: ");
      //tft.drawRect((gridStartX-2), (gridStartY-2), 67, 67, ILI9341_WHITE);
      tft.drawRect( (gridStartX -2), (gridStartY -2), ((pixelWidth*8)+4), ((pixelHeight*8)+4), ILI9341_WHITE); //grideye display frame
      tft.setCursor(245,187);tft.setTextSize(1);tft.setTextColor(ILI9341_CYAN, ILI9341_BLACK);tft.print("-GRIDeye-");
  }
  else if (ScanMode == 3){ //-----------------------------------------------------MAG-------------------------------------
    leds[1] = CRGB(60,0,60); FastLED.show(); //Status LED Purple
    tft.setTextColor(ILI9341_PINK, ILI9341_WHITE);
    tft.print("Scan Mode: MAG");
  }
  else if (ScanMode == 0){ //-----------------------------------------------------MEC-------------------------------------
    leds[1] = CRGB(85,0,0); FastLED.show(); //Status LED Red
    tft.setTextColor(ILI9341_RED, ILI9341_BLACK);
    tft.print("Scan Mode: MEC ");
    tft.setTextSize(2); tft.setTextColor(ILI9341_YELLOW, ILI9341_BLACK);
    tft.setCursor(35,75); tft.print("-ACCEL-");
    tft.setCursor(25,95); tft.print("X:");
    tft.setCursor(25,115); tft.print("Y:"); 
    tft.setCursor(25,135); tft.print("Z:");
    tft.setCursor(25,175); tft.print("MAX:");
    tft.setCursor(160,75); tft.print("-GYRO-");
tft.setCursor(150,95); tft.print("Pitch:"); 
tft.setCursor(150,115); tft.print("Roll :"); 
tft.setCursor(150,135); tft.print("Yaw  :"); 
tft.setCursor(150,175); tft.print("MAX:");

  }
  else if (ScanMode == 6){  //-----------------------------------------------------RAD-------------------------------------
    tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);
    leds[1] = CRGB(0,50,0); FastLED.show(); //Status LED Green
    leds[0] = CRGB(0,5,0); FastLED.show(); //COLOR pixel Green low
    tft.print("Scan Mode: RAD ");
    
    tft.setTextSize(2);
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    tft.setCursor(25,85);tft.print("Pulses/Sec:");
    tft.setCursor(25,105);tft.print("Avg Pulse: ");tft.setCursor(235,95);tft.print("uSv/h");

    tft.setTextSize(1);
    tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);
    tft.setCursor(55,135);tft.print("-Max safe levels are 20 mSv/incident-");
    tft.drawRoundRect(50, 129, 231, 19, 3, ILI9341_YELLOW);

    tft.setTextSize(2);
    tft.setCursor(25,155);
    tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);
    tft.println("LAST GAMMA DETECTED:");
    tft.setCursor(25,175);
    tft.println("  n/a");






    
  }
  else if (ScanMode == 4){  //-----------------------------------------------------ALT-------------------------------------

    // ALT


  }
    else if (ScanMode == 7){  //-----------------------------------------------------DIAG-------------------------------------
    tft.setTextColor(ILI9341_ORANGE, ILI9341_BLACK);
    tft.print("DIAGNOSTIC MODE");
    i2cScan = 0 ;
    DevCount = 0;
    leds[1] = CRGB(60,0,60); FastLED.show(); //COLOR pixel Purple
    leds[0] = CRGB(70,45,0); FastLED.show(); //Status LED Orange
    playTone(1740, 30);
    delay(50);
    playTone(1740, 30);
    delay(50);
    playTone(1740, 140);
  }
  else if (ScanMode == 2){  //-----------------------------------------------------GAS-------------------------------------
    leds[1] = CRGB(70,70,0); FastLED.show(); //Status LED White
    //startupindicator == 1;
    tft.setTextColor(ILI9341_YELLOW, ILI9341_BLACK);
    tft.print("Scan Mode: GAS ");
    tft.setTextSize(1);tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    tft.setCursor(20,90);tft.print("  --All measurements in PPM--");
    tft.setCursor(20,115);tft.print("Ammonia----------(NH3): ");
    tft.setCursor(20,125);tft.print("Carbon Monoxide---(CO): ");
    tft.setCursor(20,135);tft.print("Nitrogen Dioxide-(NO2): ");
    tft.setCursor(20,145);tft.print("Propane---------(C3H8): ");
    tft.setCursor(20,155);tft.print("Butane---------(C4H10): ");
    tft.setCursor(20,165);tft.print("Methane----------(CH4): ");
    tft.setCursor(20,175);tft.print("Hydrogen----------(H2): ");
    tft.setCursor(20,185);tft.print("Ethanol-------(C2H5OH): ");
  }
}
}
