Comments (5)
That certainly looks like bug! I'm not sure I need to dig out a MCP7940 to debug this issue, it looks like the issue is in the time classes and not the hardware.
from mcp7940.
My current project is not urgent so there is no rush for a fix.
from mcp7940.
The library uses a fork of Jeelabs RTC, which is now maintained by a fork at https://github.com/adafruit/RTClib
This DateTime class is limited to dates starting at 2000-01-01. Passing a UnixTime less than that date causes library underflow errors which explains the output you are seeing. I've changed the call to DateTime() to not allow any date lower than that value.
Changing the library to allow for the full UnixTime range would mean increasing data types everywhere and adding logic. Considering that the MCP7940 can't deal with dates before 2000 the library doesn't need changing.
I will update the wiki as well.
from mcp7940.
Thanks Arnd. I don't need dates/times before 2000. I guess I was led astray by the naming of the unixtime() method and assumed it used the Unix epoch like time_t based libraries.
I'll let you close this issue once you've made the update.
from mcp7940.
The library does use UnixTime starting at the correct epoch date, it just doesn't any values less than the number of seconds defined at:
const uint32_t SECS_1970_TO_2000{946684800}; ///< Seconds between year 1970 and 2000
from mcp7940.
Related Issues (20)
- Change comments & documentation to doxygen format HOT 2
- MCP7940 how to set alarm to Day-of-the-week(1-7) HOT 8
- Observation about calibrate... HOT 3
- ppm out of range HOT 2
- Battery backup not working if power to micro-controller is cut HOT 3
- Cancel a setAlarm HOT 7
- ATmega328PB & MiniCore incompatible?? HOT 3
- How to obtain power failure date/hour HOT 1
- hello guys, HOT 17
- Change source code formatting to adhere to standards HOT 1
- Add a new example program for MCP7940N power fail HOT 1
- Optimize c++ code HOT 1
- Add a regression test example program HOT 1
- How can i get number of seconds since Epoch HOT 3
- Question about int8_t MCP7940_Class::calibrate(const int8_t newTrim)... HOT 4
- Working with ESP chips HOT 4
- RPI2040 using Wire1 instead of Wire
- readRAM has wrong return type
- Wire.begin() is not called if ESP8266 is not defined
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 mcp7940.