   // or the SD library functions will not work. 
   if (SD.exists("example.txt")) {
     Serial.println("[FAIL] example.txt already exists.");
+    lcd.println("TT[F]file exists\nTRT");
     pass = false;
-  }
-  else {
+  } else {
     Serial.println("[PASS] no example.txt, good.");
   }
 

 	 
 */
#include <SD.h>

File myFile;

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);

  digitalWrite(10, HIGH);
  pinMode(10, OUTPUT);

  delay(5000);

  while(!SD.begin(10)) {
    Serial.println("[FAIL] initialization failed.");
    delay(1000);
  }
  Serial.println("[PASS] initialization done.");

}

void loop()
{
  bool pass = true;
  
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.

  SD.remove("example.txt");

  if (SD.exists("example.txt")){ 
    lcd.println("TT[F]remove file\nTRT");
    Serial.println("[FAIL] example.txt not removed.");  
    pass = false;
  } else {
    lcd.println("TT[P]remove file\nTRT");
    Serial.println("[PASS] example.txt removed.");
  }

  if (pass) {
    lcd.println("TT---------------\nTRT");
    lcd.println("TT[P]BOARD OK\nTRT");
    Serial.println("----\n[PASS] ALL TESTS PASS\n----\n");
  } else {
    Serial.println("----\n[FAIL] one or more tests failed\n----\n");
  }
  
  digitalWrite(pass ? GREEN : RED, HIGH);
  digitalWrite(10, LOW);
}

void loop() {
  while(1);
}
