Well I downloaded a much newer lib and made a small adjustment to the void fanTimer() section. I also made the change you suggested for fanTimer function. Now I'm not getting any compiling errors but I am not getting any reaction on the hardware end. My serial is reading time correctly but I'm not getting any output the the relay.
Right now my setup is just a mockup with leds instead of getting the relays out but no fire.
#include <DS3232RTC.h>
#include <Time.h>
#include <Wire.h>
const int RELAY1 = 22;
const int RELAY2 = 23;
const int RELAY3 = 24;
const int RELAY4 = 25;
void setup() {
Serial.begin(9600);
setTime(10,1,0,9,14,16);
}
void loop()
{
fanTimer(); //add call to function
digitalClockDisplay();
delay(1000);
}
void digitalClockDisplay(){
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.print(" ");
Serial.print((char)223);
Serial.print('C');
Serial.println();
}
void printDigits(int digits){
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(":");
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}
void fanTimer()
{
time_t t = now();
hour(t);
minute(t);
second(t);
if ( minute(t) >= 0 && minute(t) < 5)
{
digitalWrite ( RELAY2, HIGH );
}
else
{
digitalWrite ( RELAY2, LOW );
}
}