 #include <dht11.h>
 
 
+#include <SPI.h>
+#include <SD.h>
+
+
 #define DHT11_PIN 3 
 
 dht11 DHT11;
+const int chipSelect = 10;
+File dataFile;
 
 
 void setup() {

        char error[] = "clock error" ;
        Serial.println(error);
        for(;;);
    }

    Alarm.timerRepeat(10, log_data);

    }

    buffer[16] = '\0' ;
    // @debug
    Serial.println(buffer);
    // write to SD card
    dataFile.println(buffer);
    dataFile.flush();
    
}

// param n is to ensure n*10 ms delay
