 
   // open the file. note that only one file can be open at a time,
   // so you have to close this one before opening another.
-  File dataFile = SD.open("data.txt", FILE_WRITE);
+  File dataFile = SD.open(filename, FILE_WRITE);
 
   byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
   // retrieve data from DS3231

#endif    
    sample_count = 0;
    sum = 0;
    append_to_disk(voltage);

#if DEBUG_TO_SD
  write_Text_To_Disk("data.txt","Woke up, logging");
#endif

#if DEBUG

        delay(10);
    }
    // calculate the voltage
    //https://startingelectronics.org/articles/arduino/measuring-voltage-with-arduino/
    // use 5.0 for a 5.0V ADC reference voltage
    // 5.015V is the calibrated reference voltage
    voltage = ((float)sum / (float)NUM_SAMPLES * 5.05) / 1024.0;
