74 Commits
Author SHA1 Message Date
siddacious 7288401b96 fixing rebase merge issues 2020-04-20 12:31:27 -07:00
siddacious a642882b33 fixing ambiguous argument type 2020-04-20 12:30:44 -07:00
siddacious 944579172c actionified, formatted and doxy'd 2020-04-20 12:30:44 -07:00
Edgar Bonet ce96577ba2 Add new method DateTime::isValid()
The documentation of `DateTime::DateTime(year, month...)' has been updated
to mention that a DateTime can be invalid and that its validity can be
tested with `isValid()'.

Fixes #127.
2020-04-18 12:24:04 +02:00
Edgar Bonet da605f788f Expand the Doxygen documentation of DateTime 2020-04-16 17:51:12 +02:00
Edgar Bonet 1e76f010b1 Fix Y2068 rollover in DateTime::secondstime()
The `long' return type would roll over at 2068-01-19 03:14:08. Using
`uint32_t' postpones the rollover to 2136-02-07 06:28:16. The method now
works correctly up to 2100-02-28 23:59:59, right before the leap year
computation fails.
2020-04-15 17:31:58 +02:00
Jadon Miller 8837751285 Removed 12-Hour Constructor
Per @drak7 's request, I've removed my 12 hour compatible constructor. Once again, Visual Studio caught some whitespace.
2020-04-09 17:15:24 -04:00
Jadon Miller 0f75eae620 Consolidated apTag Variables
Combined the two apTags. It seems Visual Studio also deleted some whitespace it found in the toString function.
2020-04-09 17:06:36 -04:00
Jadon Miller d10eadd991 Combined toString() Functions
I combined the two toString() functions into one function that searches for the "ap" or "AP" tag (returns lower and uppercase AM/PM, respectively) to output 12-Hour time. Thanks @edgar-bonet
2020-04-04 12:05:35 -04:00
Jadon Miller 85826c3f6d Optimized and Moved isPM() Function
Thanks to @edgar-bonet I eliminated the if statement and moved the function to the .h file with the other inline functions.
2020-04-04 11:34:19 -04:00
Jadon Miller 7e01b61c12 Added 12-Hour Getter Functions
I added a DateTime::twelveHour function that returns the hour on a range of 1-12 for 12-Hour use, as well as a DateTime::isPM function that returns true if the time is PM.
2020-04-03 17:41:39 -04:00
Jadon Miller f231b9db6f Added toString Function for 12-Hour Time
I added the to12hrString function that outputs the DateTime object in a 12-Hour format. Use the "aa" tag for the AM/PM indicator. Other than the new tag and twelve-hour conversion, it's the same as the toString function.
2020-04-03 10:25:40 -04:00
Jadon Miller 583b3f937e Added 12-Hour Compatible Constructor (isPM argument) 2020-04-03 09:00:29 -04:00
Bit-Mac 41d113cda0 Update RTClib.cpp
The current RTC_DS3231::getTemperature function does not handle negative Celsius temperatures correctly.  This correct behavior can be achieved by using a signed 8-bit integer type for the variable "msb" as this allows the sign to be retained for the subsequent float conversion.   Line 1064 was changed to move the "msb" variable to a new line with the int8_t typing. This was tested on an UNO R3 and DS3231 module using a small, frozen blue-ice block with a foam drink cover to achieve negative Celsius temperatures for the DS3231 module.
2020-03-26 12:10:31 -05:00
marcusblevin d6a3857256 Update comments 2020-03-01 01:54:07 -05:00
marcusblevin de5712d759 Add documentation 2020-03-01 01:38:08 -05:00
marcusblevin 8fc4885b83 Add return when setting alarms 2020-02-29 17:06:42 -05:00
marcusblevin 08d95cb51c Modify to match PR 69
Add alarm support for DS3231
2019-11-09 16:37:01 -05:00
Nikos Mouratidis ff898af1fc Detect possible absence of DS3231 in begin()
RTC_DS3231::begin now tests connection with DS3231 by using Wire.beginTransmission and Wire.endTransmission before returning true. Returns false is DS3231 is not found.
2019-10-22 05:33:19 +08:00
Edgar Bonet 3069812e0d Remove the last cell in the daysInMonth array
This array is used in computations where the total number of days from
the previous months in the year is added or subtracted from a day count.
Since December is never among the previous months, the twelfth cell in
the array is not useful.

Fixes #114: an incompatibility with Paul Stoffregen's Time library
arising from both libraries defining identical arrays of constants.
2019-10-09 21:20:37 +02:00
Edgar Bonet c5b0b9ebbc Doxygen introduction to the available classes 2019-09-12 21:30:28 +02:00
Szymon Klause 35d4cebcd1 Memory optimalization, switch replaced by static PROGREM aray. 2019-07-30 18:58:32 +02:00
Szymon Klause cc13d5e1e7 Added 'MMM' - the abbreviated English month name (e.g. 'Jan' to 'Dec')
Added 'DDD' - the abbreviated English day name (e.g. 'Mon' to 'Sun

Signed-off-by: Szymon Klause <szymon.klause@gmail.com>
2019-07-30 10:50:09 +02:00
Szymon Klause 069772aaa5 Function format renamed to toString.
Extended documentation to describe function way of working.
Updated example as toStrng.ino
toString added to keywords
2019-07-29 20:51:27 +02:00
Szymon Klause 4f60418965 Function format documentation updated. Keywords for format defined. 2019-07-28 17:41:43 +02:00
Szymon Klause 24d13d64ea add format function to library, which allow to get date and time with different patterns 2019-07-28 14:36:06 +02:00
Matt Goodrich 89c419defc Doxygen; prefixed DS1307 enums to avoid collisions (ON and OFF are commonly used) 2019-07-12 09:53:47 -04:00
Matt Goodrich 040a6ebbcc Resolve conflicts for gutierrezps-datetime-comparisons 2019-07-01 17:25:16 -04:00
Matt Goodrich 3f7d2e2b43 Merge pull request #112 from edgar-bonet/rtc-micros
Implement RTC_Micros with tunable drift
2019-07-01 16:29:48 -04:00
Matt Goodrich 75607ab38a Merge pull request #102 from Takaitra/PCF8523-calibrate
Add calibrate method to RTC_PCF8523
2019-07-01 16:25:03 -04:00
Matt Goodrich 9f83e4d432 Merge pull request #92 from edgar-bonet/millis-rollover
Make RTC_Millis immune to millis() rollover events
2019-07-01 15:56:07 -04:00
Matt Goodrich c7d5c75b28 Merge pull request #62 from toannds/master
Add function to get temperature for DS3231
2019-07-01 15:24:29 -04:00
Matt Goodrich 3c53221002 Merge pull request #40 from AxelTB/timestampFunctionPR
Simple Timestamp function
2019-07-01 15:16:44 -04:00
Matt Goodrich 96a419e3b9 Merge pull request #32 from djix123/master
Add support for Adafruit Trinket
2019-07-01 15:06:07 -04:00
Gutierrez PS 4c81c0c41f Added comparison operators to DateTime class 2019-05-06 19:24:07 -03:00
Edgar Bonet aa112e874c Implement tunable RTC_Micros
This is identical to RTC_Millis, except for:

 * The method now() has to be called more often than once every 71.6
   minutes.
 * The clock can be syntonized (i.e. its drift tuned) with a 1 ppm
   resolution using adjustDrift(): a positive adjustment makes the clock
   faster.

Note that syntonization does not introduce time discontinuities.
2019-05-06 21:28:07 +02:00
Edgar Bonet 2d096da6d1 Make RTC_Millis immune to millis() rollover events 2018-11-20 21:49:28 +01:00
Matthew 7a79dc7267 Add calibrate method to RTC_PCF8523 2018-10-15 21:19:02 -07:00
driverblock 0ba9280b39 ESP32 complains about syntax
Clean up syntax for Jan, Jun, Jul tests
2017-04-09 09:02:53 -04:00
toannds c3d2d11fd4 Add function to get temperature to DS3231
Read temperature from register 0x11 of DS3231
Change the example accordingly
2016-03-17 01:30:57 +08:00
ladyada 8f2abae08f remove serial debug 2016-02-15 12:32:47 -05:00
ladyada a02d18f151 PCF8523 & DS3231 2016-01-29 13:07:09 -05:00
ladyada e78475848a basic PCF8523 support 2015-12-18 00:07:47 -05:00
ladyada 12e2d2adfd ugh thats annoying, dayOfWeek is now renamed to dayOfTheWeek - friends don't let friends make #define's that match function names :(
https://github.com/adafruit/RTClib/issues/35 fixed
2015-10-06 00:36:10 -04:00
ladyada 852a102397 get rid of messy WIRE define - more compat with platforms 2015-10-06 00:21:24 -04:00
ladyada 03d0a6ad29 so much typecasting! https://github.com/adafruit/RTClib/issues/33 should be good now 2015-10-06 00:14:44 -04:00
ladyada 5043f6585d add handy WIRE.begin() in case people forget, fix https://github.com/adafruit/RTClib/issues/46 2015-10-06 00:10:06 -04:00
ladyada c2f06bc09c typecast fixes for Wire.write() and Zero functionality 2015-09-20 22:40:25 -04:00
ladyada 93f73f9599 esp8266 compilability (not fully tested, but at least compiles) 2015-08-02 00:40:36 -04:00
AxelTB 73fd2e153a Timestamp function with options 2015-06-01 15:08:11 +02:00