Makuna on master
enable travis build using platf… (compare)
Makuna on 2.3.5
RtcDS3231
class, why is the temperature returned as a RtcTemperature
object instead of an int
or a float
? I do understand that the library has to do some math manipulations with a pair of 8-bit registers from the chip in order to reconstruct the actual value. but I don't understand why such math was abstracted away from RtcTemperature::GetTemperature()
method into a wholly new class. maybe I'm failing to understand the rationale for this. library version: 2.3.2
int16_t scaledDegC = ((highByteDegreesC << 8) | (lowByteDegreesC & 0xC0)) >> 6;
_centiDegC = scaledDegC * 100 / 4;
RtcTemperature
constructor and not in the RtcDS3231::GetTemperature()
method, which is conceptually closer to the hardware from it gets the data.
interesting. having myself worked in the past on very restricted environments (e.g. a PIC with 256 bytes of RAM), I always paid attention to whose details. but more recently I've been working on a bigger hardware (Arduino MKR) and suddenly I forgot to consider such nuances and optimizations.
thank you very much for your promptly input!
i changed Delay now as below seems 10sec is working fine but i need a bit shorter time per loop as i will have button input for logging as well. always every second display is wrong down to 1sec delay at 0.5 sec delay two displays are right then two displays are wrong? seems like only uneven number of seconds can be displayed? see last log of 0.7sec Delay only uneven seconds are displayed?
10 Sec Delay
10:17:46.085 -> compiled: Apr 18 201910:17:35
10:17:46.138 -> 04/18/2019 10:17:35
10:17:46.138 -> RTC lost confidence in the DateTime!
10:17:46.185 -> RTC is the same as compile time! (not expected but all is fine)
10:17:46.285 -> 04/18/2019 10:17:35
10:17:56.197 -> 04/18/2019 10:17:45
10:18:06.201 -> 04/18/2019 10:17:55
10:18:16.201 -> 04/18/2019 10:18:05
7 Sec Delay
10:20:56.795 -> compiled: Apr 18 201910:20:45
10:20:56.795 -> 04/18/2019 10:20:45
10:20:56.842 -> RTC is the same as compile time! (not expected but all is fine)
10:20:56.896 -> 04/18/2019 10:20:45
10:21:03.833 -> 00/00/2000 00:00:00
10:21:03.880 -> RTC lost confidence in the DateTime!
10:21:10.845 -> 04/18/2019 10:20:59
10:21:17.843 -> 00/00/2000 00:00:00
10:21:17.881 -> RTC lost confidence in the DateTime!
10:21:24.833 -> 04/18/2019 10:21:13
5 Sec Delay
10:23:07.322 -> compiled: Apr 18 201910:22:55
10:23:07.375 -> 04/18/2019 10:22:55
10:23:07.375 -> RTC lost confidence in the DateTime!
10:23:07.422 -> RTC is the same as compile time! (not expected but all is fine)
10:23:07.475 -> 04/18/2019 10:22:55
10:23:12.444 -> 00/00/2000 00:00:00
10:23:12.444 -> RTC lost confidence in the DateTime!
10:23:17.464 -> 04/18/2019 10:23:05
10:23:22.438 -> 00/00/2000 00:00:00
10:23:22.438 -> RTC lost confidence in the DateTime!
10:23:27.415 -> 04/18/2019 10:23:15
3 Sec Delay
10:24:48.776 -> compiled: Apr 18 201910:24:37
10:24:48.776 -> 04/18/2019 10:24:37
10:24:48.814 -> RTC lost confidence in the DateTime!
10:24:48.861 -> RTC is the same as compile time! (not expected but all is fine)
10:24:48.908 -> 04/18/2019 10:24:37
10:24:51.894 -> 00/00/2000 00:00:00
10:24:51.894 -> RTC lost confidence in the DateTime!
10:24:54.864 -> 04/18/2019 10:24:43
10:24:57.879 -> 00/00/2000 00:00:00
10:24:57.879 -> RTC lost confidence in the DateTime!
10:25:00.892 -> 04/18/2019 10:24:49
1 Sec Delay
10:26:01.916 -> compiled: Apr 18 201910:25:50
10:26:01.963 -> 04/18/2019 10:25:50
10:26:01.963 -> RTC lost confidence in the DateTime!
10:26:02.017 -> RTC is newer than compile time. (this is expected)
10:26:02.064 -> 00/00/2000 00:00:00
10:26:02.064 -> RTC lost confidence in the DateTime!
10:26:03.069 -> 04/18/2019 10:25:51
10:26:04.071 -> 00/00/2000 00:00:00
10:26:04.071 -> RTC lost confidence in the DateTime!
10:26:05.065 -> 04/18/2019 10:25:53
10:26:06.052 -> 00/00/2000 00:00:00
10:26:06.099 -> RTC lost confidence in the DateTime!
10:26:07.041 -> 04/18/2019 10:25:55
0.5 Sec Delay
10:27:01.559 -> compiled: Apr 18 201910:26:50
10:27:01.612 -> 04/18/2019 10:26:50
10:27:01.612 -> RTC is older than compile time! (Updating DateTime)
10:27:01.659 -> 00/00/2000 00:00:00
10:27:01.659 -> RTC lost confidence in the DateTime!
10:27:02.180 -> 00/00/2000 00:00:00
10:27:02.180 -> RTC lost confidence in the DateTime!
10:27:02.668 -> 04/18/2019 10:26:51
10:27:03.139 -> 04/18/2019 10:26:51
10:27:03.663 -> 00/00/2000 00:00:00
10:27:03.663 -> RTC lost confidence in the DateTime!
10:27:04.182 -> 00/00/2000 00:00:00
10:27:04.182 -> RTC lost confidence in the DateTime!
10:27:04.683 -> 04/18/2019 10:26:53
10:27:05.185 -> 04/18/2019 10:26:53
0.7 Sec Delay