Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added lifespan constant #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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