That code won't even compile. The reason why would be more obvious if you had done an Auto Format as I requested.
I don't know how you know it's back to 0, since you never output the value read from the EEPROM in the code.
I suspect this code doesn't do what you think it does:
void water_daily(){
if (totalMilliLitres > 0)
{
eeprom_daily = totalMilliLitres /1000;
}
else
eeprom_daily != totalMilliLitres /1000;
Serial.println ("water_daily");
EEPROM.put(13,eeprom_daily);
}
Again, Auto Format makes things more clear:
void water_daily() {
if (totalMilliLitres > 0)
{
eeprom_daily = totalMilliLitres / 1000;
}
else
eeprom_daily != totalMilliLitres / 1000;
Serial.println ("water_daily");
EEPROM.put(13, eeprom_daily);
}
This line:
eeprom_daily != totalMilliLitres / 1000;
does nothing.