 
 // =============================================
 
-//#include <Adafruit_Sensor.h>
 #include <Wire.h>
 #include "RTClib.h"
 #include "DHT.h"
-#include <SD.h>
+#include "Fat16.h"
 
 #ifdef TRANSMITTER_WIFI
   #include <libmaple/iwdg.h>

  
  if (!rtc.initialized()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    // TODO - this could make a web request to set and continually update the RTC

    char timestamp[50];
    int i = 0;
    bool timestamp_input = false;

    Serial.println("RTC needs to be set, enter the current unix timestamp");

    while (true) {
      if (Serial.available()) {
        char c = Serial.read();
        Serial.print("read: ");
        Serial.println(c);
        if (c == '\n') {
          Serial.println("done setting");
          break;
        } else {
          timestamp[i++] = c;
        }
      }
    }
    
    rtc.adjust(DateTime(atoi(timestamp)));
  }
}


#endif

#ifdef TRANSMITTER_GSM
  SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
  SoftwareSerial *fonaSerial = &fonaSS;

  Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
  bool gsmConnected = false;
#endif

void setup() {
  watchdog_init();
