   delay(100);
 }
 
-float getTemp() {
-  //returns the temperature from one DS18S20 in DEG Celsius
+DateTime getTime() {
+  digitalWrite(RTC_POWER_PIN, HIGH);
+  DateTime now = RTC.now();
+  digitalWrite(RTC_POWER_PIN, LOW);
+  return now;
+}
+
+float getTemp() { //returns the temperature from one DS18S20 in DEG Celsius
 
   byte data[12];
   byte addr[8];

  ds.select(addr);
  ds.write(0x44, 1); // start conversion, with parasite power on at the end

  byte present = ds.reset();
  ds.select(addr);
  ds.write(0xBE); // Read Scratchpad


  for (int i = 0; i < 9; i++) { // we need 9 bytes
    data[i] = ds.read();

  float temperatureSum = tempRead / 16;

  return temperatureSum;
}

void setup(void) {
  
  Serial.begin(115200);
  
  // Configure digital output connected to rtc module.
  pinMode(RTC_POWER_PIN, OUTPUT);
  digitalWrite(RTC_POWER_PIN, HIGH);
  Wire.begin(); // I2C init as master
  RTC.begin();
  digitalWrite(RTC_POWER_PIN, LOW);

  pinMode(10, OUTPUT);
  pinMode(SD_CARD_SELECT, OUTPUT);
  SD.begin(SD_CARD_SELECT);
  
  Serial.println(F("Setup complete."));
}

void loop(void) {
  
  // Log the sensor reading
  logSensorReading();

  Sleepy::loseSomeTime(LOGGING_FREQ_SECONDS * 1000);
}

