Okay, the problem is if statment gets to long
I'm making watering automation and i have little problem about days
I have 7 days on lcd if it's 1 lcd prints name of the day else its "--"
So i have 7 split numbers on lcd
What i need: i started to compare functions with RTC clock
With time it's fine
But when i came to day selections I just have to many vars
I mean i could write everything down, but it must be more clever way to do that, so I ask you The smartest arduinoheads in the world
int daystate;
void FUNC_COMPARE_Timer_WeekDay() {
if (EEday0 >=1){
daystate == 0;
}
else if( EEday1 >= 1){
daystate == 1;
}
else if (EEday2 >= 1) {
daystate == 2;
}
else if( EEday3 >= 1){
daystate == 3;
}
else if (EEday4 >= 1) {
daystate == 4;
}
else if( EEday5 >= 1){
daystate == 5;
}
else if (EEday6 >= 1) {
daystate == 6;
}
Serial.print(daystate);
DateTime now = rtc.now();
if (EEhour == now.hour() && EEminute == now.minute()) && daystate == now.dayOfTheWeek) {
digitalWrite(valve1, HIGH);
}
else if (EEhour1 == now.hour() && EEminute1 == now.minute()) {
digitalWrite(valve1, LOW);
}
}
/*oid WeekDayState(int state){
if (EEday0 || EEday1 || EEday2 || EEday3 || EEday4 || EEday5 || EEday6 >= 1){
state == WeekDayOn;
}
else{
state == WeekDayOff;
}
}*/
now.dayOfTheWeek counts from 0-6
Thankfull for your ideas