Thanks for support.It started working.I need clarification on below.
I am following below code https://community.blynk.cc/t/time-clock-wont-read-correct/17689
I have 2 TimeWidgetinput . One from Monday_FRI & Sat_sun. I would like to choose weekday. if Its weekdays Relay1 will be operated if its weekend relay 2 is operated…
In below code How can i decide weather its weekday or weekend,Or Based on RTC date & time it judge weekday or weekend
void MonDay_FriDay_TimeCheck()
{
sprintf(Date, "%04d/%02d/%02d", year() , month() , day() );
sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());
Blynk.virtualWrite(V11, Date);
Blynk.virtualWrite(V10, Time);
if (mondayfriday == 1)
{
// call with timer every 30 seconds or so
// Get RTC time
sprintf(currentTime, "%02d:%02d:%02d", hour(), minute(), second());
Serial.print("Current Time: ");
Serial.println(currentTime);
// Get Time Input Widget time
sprintf(startTime, "%02d:%02d:%02d", SThour, STmin, STsec);
Serial.print("Start Time: ");
Serial.println(startTime);
sprintf(startTime, "%02d:%02d:%02d", SPhour, SPmin, SPsec);
Serial.print("Stop Time: ");
Serial.println(startTime);
if (hour() == SThour || hour() == SPhour)
{
if (minute() >= STmin && minute() <= SPmin)
{
Serial.println("RELAY IS ON");
digitalWrite(D7, HIGH); // Turn ON built-in LED
led22.on();
} else
{
Serial.println("RELAY IS OFF");
digitalWrite(D7, LOW); // Turn ON built-in LED
led22.off();
}
}
}
}