     myFile.println(value);
     myFile.close();
     
-    // Update counter
-    counter++;
-    
     Serial.println("done.");
   } else {
     // if the file didn't open, print an error:

}

boolean buttonPressed = false;
void doButtonPressed()
{
  buttonPressed = true;
}

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
   pinMode(10, OUTPUT);
  
  if (!startSD())
  {
    return;
  }
  
  logToFile("mtest.txt", counter);
  
  readFileToSerial();
  
  // Trigger backlight on push button on pin 2 (interrupt 0)
  attachInterrupt(0, doButtonPressed, RISING);
}

void loop()
{
  if (buttonPressed)
  {
    delay(250);
    Serial.println("Woo");
    if (startSD())
    {
      logToFile("mtest.txt", counter);
      readFileToSerial();
    }
    buttonPressed = false;
  }
}



boolean startSD()
{
  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
  pinMode(10, OUTPUT);

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return false;
