 #define LIGHTPIN D5
 #define SENSORPIN D8
 #define DHTTYPE DHT11
-#define DELAY_TIME_TO_SEND  5000 // 15 min
+#define DELAY_TIME_TO_SEND  360 // 5 min
 #define TABLE_LEITURA "leitura"
 #define TABLE_MOTION "motion"
 #define CLIENT_EMAIL "well.oliveira.snt@gmail.com"

    return String(TABLE_LEITURA) + " failed to send:";
}

void inline updateMontionSensor() {
    if (digitalRead(SENSORPIN) != motionSensorRead) {
        motionSensorRead = digitalRead(SENSORPIN);
        motion["state"] = String(motionSensorRead);

    digitalWrite(LED_BUILTIN, !Firebase.getBool(String(DEVICE_PATH) + "light"));
}

//TODO verify wheter is this okay or not
void inline updateNtp() {
    WiFi.hostByName(ntpServerName, timeServer);
    setSyncProvider(getNtpTime);
    setSyncInterval(300);
}

void inline updateCountAndPrint() {
    delay(100);
    count++;
    Serial.println("/-----Count-------");
    Serial.println(count);
    Serial.println("------Count------/");
}

void loop() {
    updateNtp();
    readMotionSensorAndSendToFirebase();
    readLeituraAndSendToFirebase();
    updateLighAndFan();
    updateCountAndPrint();
}
