Skip to content

Commit

Permalink
Added lifespan constant
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkrapido committed Jun 13, 2020
1 parent 5f38d6b commit f5f5769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lifeclock-v1/constants.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lifeclock-v1/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f5f5769

Please sign in to comment.