Comments (7)
Sounds like a good idea! Indeed, I have thought about doing that too, but I haven't. It would just take writing some code to convert the epoch to the date/time parameters for the registers.
The reason that I have not yet done this is because I have written code that takes the computer time and directly sends it to the logger, thus negating the need for any human input. This link works with our older-model data loggers, but should be able to be ported to work with more generic Arduino devices: https://github.com/NorthernWidget/ALogTalk.
from ds3231.
I found this for the Arduino nano 33 iot. There you could set the time by giving the epoch.
It s a nice solution, but the RTC of the nano is a really bad rtc compared to the DS3231.
One point would be setting the correct local time.
My first proposal would be starting with
setEpoch(time_t epoch)
and epoch in the first approach is the already corrected time value for the local time...
I can test if you want!
best regards
Frank
from ds3231.
If you would like to test some code and make a PR, please do! I do not have time or plans to make any significant edits here in the foreseeable future.
from ds3231.
Hi,
I have one question....
I found the following constuctor:
DateTime::DateTime (uint32_t t) {
t -= SECONDS_FROM_1970_TO_2000; // bring to 2000 timestamp from 1970
ss = t % 60;
t /= 60;
mm = t % 60;
t /= 60;
hh = t % 24;
uint16_t days = t / 24;
uint8_t leap;
for (yOff = 0; ; ++yOff) {
leap = isleapYear(yOff);
if (days < 365 + leap)
break;
days -= 365 + leap;
}
for (m = 1; ; ++m) {
uint8_t daysPerMonth = pgm_read_byte(daysInMonth + m - 1);
if (leap && m == 2)
++daysPerMonth;
if (days < daysPerMonth)
break;
days -= daysPerMonth;
}
d = days + 1;
}
It seems you can gibe the epoch, right?
But the RTC is then not feed with the values?
Can you give some informations?
Frank
from ds3231.
No I think it is not the RTC class...
from ds3231.
You are correct: this is in a separate class.
from ds3231.
Thank you for the PR #38. Looks like you tested it too and it works, so I'm closing this.
from ds3231.
Related Issues (20)
- New Release Missing HOT 1
- Update to 1.10. brocke compling, but it work with old library V1.0.7 ! HOT 8
- Not compiling HOT 1
- AlarmBits parameter not initialized in getA1Time and getA2Time
- setEpoch() does not work with Unix Time but with time since 01/01/2000 00:00:00 HOT 13
- DS3231_test:16:8: error: 'DS3231 clock' redeclared as different kind of symbol DS3231 clock; ^~~~~ HOT 1
- Added Changelog HOT 1
- Compile errors with recent getAXAlarm() and checkIfAlarm() overloads HOT 1
- New versions are not published to Arduino library manager HOT 1
- DateTime class accepts type-conflicting assignments HOT 3
- Wrong text in DS3231/Documentation/Time-Retrieval.md HOT 1
- DateTime constructor crashes SAMD21 HOT 1
- Year 2106 potential problem? HOT 1
- Cannot find any mention of which day of the week is 1 HOT 1
- About the DS3231 in readme.md has broken link
- OSF flag needs independent reset function.
- undefined reference to DateTime::dayOfTheWeek() HOT 3
- [Question]: Why do we use yOff instead use the Year In DateTime? HOT 5
- no .begin
- Possible to add sketch to adjust Aging Register?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ds3231.