mirror of https://github.com/sqfmi/Watchy.git
DS3231 & PCF8563 working WatchyRTC.
parent
1bfbc55f4a
commit
0c275c5e72
|
@ -8,8 +8,11 @@
|
||||||
#define PCF8563 1
|
#define PCF8563 1
|
||||||
#define RTC_DS_ADDR 0x68
|
#define RTC_DS_ADDR 0x68
|
||||||
#define RTC_PCF_ADDR 0x51
|
#define RTC_PCF_ADDR 0x51
|
||||||
#define YEAR_OFFSET_DS 1970
|
#define RTC_YEAR_OFFSET 1900 // Use for calculation to display year properly.
|
||||||
#define YEAR_OFFSET_PCF 2000
|
#define RTC_CENTURY_OFFSET 100 // Short Year offset.
|
||||||
|
#define RTC_1900TO1970 2208988800UL // Subtract from NTP to get Epoch.
|
||||||
|
#define RTC_1970TO2000 946684800UL // Subtract from Epoch to get Y2k.
|
||||||
|
#define RTC_1900TO2000 (RTC_1900TO1970 + RTC_1970TO2000) // Subtract from NTP to get Y2k.
|
||||||
|
|
||||||
class WatchyRTC {
|
class WatchyRTC {
|
||||||
public:
|
public:
|
||||||
|
@ -31,4 +34,4 @@ class WatchyRTC {
|
||||||
String _getValue(String data, char separator, int index);
|
String _getValue(String data, char separator, int index);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue