Hello, I am working with An Arduino Uno R3 and an Adafruit PCF8523 Real Time Clock Assembled Breakout Board Adafruit PCF8523 Real Time Clock Assembled Breakout Board : ID 3295 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits
I am creating a Light timer using a Relay Module and RTC that will control the relays -
I am working with the RTCLib that is "A fork of JeeLab's fantastic real time clock library for Arduino." - Found at RTClib/README.md at master · adafruit/RTClib · GitHub
In the following example (RTClib/examples/pcf8523/pcf8523.ino) , can anyone explain (7,12,30,6)?
// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now + TimeSpan(7,12,30,6));
I poked around in the Library File (RTClib/RTClib.cpp)and found the code below, but this doesn't really mesh up with how I understand the (7,12,30,6) -
TimeSpan (int32_t seconds = 0);
TimeSpan (int16_t days, int8_t hours, int8_t minutes, int8_t seconds);
TimeSpan (const TimeSpan& copy);
int16_t days() const { return _seconds / 86400L; }
int8_t hours() const { return _seconds / 3600 % 24; }
int8_t minutes() const { return _seconds / 60 % 60; }
int8_t seconds() const { return _seconds % 60; }
int32_t totalseconds() const { return _seconds; }
Also, Can I setup a string array to simplify calling upon times for an event timer?
My idea example:
char CurrentTime[2] = {now.hour()now.minute()}
if CurrentTime = currentTime[12,30] //12:30pm - Did I get the Syntax right?
//launch a subroutine –
if CurrentTime = currentTime[13,45] //1:45pm -
//launch a subroutine –
if CurrentTime = currentTime[16,25] //4:25pm –
//launch a subroutine –
if CurrentTime = currentTime[0,30] //12:30am –
//launch a subroutine –
Is there a good way to divide the day and easily modify the value to be 3x, 5x, 6x, etc. Per day?
Thank you in Advance