You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
moonPhases returns wrong results when Year/Month/Day are read from the RTC #1
I am trying to use the code for a Moon Clock I am making and while the Moonphases algorithm
works well I am having a strange problem. When I manually assign values to (year, month, day) the
moonPhases returns proper values but when I get the values from the RTC clock for exactly the same
date, moonPhases returns wrong results. (but when you print the read [year, month, day] the values
are correct).
p.s. The discrepancy first shows up in the following line of code of the MoonPhases( ) function. unsigned long meeDT = pow((jd - 2382148), 2) / (41048480 * 86400);
int nowDay = 31;
int nowMonth = 12;
int nowYear = 2020;
int moonPhase;
void setup() {
Serial.begin(57600);
}
void loop() {
DateTime now = rtc.now();
// If I read the values from the RTC, the moonPhases returns wrong results!
nowYear = now.year(); // result is 2020
nowMonth = now.month(); // result is 12
nowDay = now.day(); // result is 31
________________________________
From: TorLAB ***@***.***>
Sent: Saturday, July 3, 2021 7:54 PM
To: TorLab/MoonPhaseCalculation ***@***.***>
Cc: hgg2k ***@***.***>; Author ***@***.***>
Subject: Re: [TorLab/MoonPhaseCalculation] moonPhases returns wrong results when Year/Month/Day are read from the RTC (#1)
Hi,
This is my old account for which I don't have access anymore.
Do you still have this issue ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABNYP2ZRMLFJLFW55VZ5CDDTV46EHANCNFSM4VPT2V6A>.
Activity
faytor commentedon Jul 3, 2021
Hi,
This is my old account for which I don't have access anymore.
Do you still have this issue ?
hgg2k commentedon Jul 3, 2021
faytor commentedon Aug 17, 2021
Hi @hgg2k,
I made a new version of this in my new account. You may find it useful:
https://github.com/faytor/moon_phase_calculator