diff --git a/lifeclock-v1/constants.h b/lifeclock-v1/constants.h index a18a8da..53bee41 100644 --- a/lifeclock-v1/constants.h +++ b/lifeclock-v1/constants.h @@ -1,6 +1,8 @@ #ifndef CONSTANTS_H #define CONSTANTS_H +#define DESIRED_LIFESPAN 100 // years + #define LED_PIN 6 #define SET_LED_PIN 42 #define DATE_LED_PIN 43 diff --git a/lifeclock-v1/functions.cpp b/lifeclock-v1/functions.cpp index 550cb22..41c7763 100644 --- a/lifeclock-v1/functions.cpp +++ b/lifeclock-v1/functions.cpp @@ -250,7 +250,7 @@ void setTime() { unsigned long getSecondsTillDeath() { tm2.Day = birthDate.date; tm2.Month = birthDate.month; - tm2.Year = birthDate.year + 80 - 1970; + tm2.Year = birthDate.year + DESIRED_LIFESPAN - 1970; tm2.Hour = tm2.Minute = tm2.Second = 0; time_t t1 = makeTime(tm); time_t t2 = makeTime(tm2);