Change value Between 2 delay to change duration of LED lights

Hi Everyone,

I am writing a program with 2 alarms to control some LED lights, when I set the alarm i can also change the duration of the LED lights,
So the problem is every time I change the duration of one of the alarms it uses the duration in the other alarm,
I have tried all different way to fix this problem but still I can't work this out.

I can post the whole code but I think the problem is in a few lines of the code.

Thanks

if (alarmSet)
{
if (alarmHours == lastHour && alarmMinutes == lastMinute)
{

digitalWrite(backLight, LOW);
Serial.print("CrossFade1");
CrossFade1();
digitalWrite(backLight, HIGH);

}
else if (alarmSet1)
{
if (alarmHours1 == lastHour && alarmMinutes1 == lastMinute)
{
digitalWrite(backLight, LOW);
Serial.print("CrossFade2");
CrossFade2();
digitalWrite(backLight, HIGH);
}
}

}


if (CrossFade1)
{
delay((durationHour*60 + durationMinutes)*6.6);
}

else if (CrossFade2)
{
delay((durationHour1*60 + durationMinutes1)*4.4);
}

Circadian_Light_Control_Box_v1.1.ino (32.2 KB)

Please post ALL of your code, and for the love of ........... USE CODE TAGS

yay code tags, click the </> on the top left,
yay a little box designed for code and errors :D
if (CrossFade1)
else if (CrossFade2)

What are these lines checking ? CrossFade1 and CrossFade2 are functions, not variables. Neither of the functions return a value and in any case you are calling them incorrectly in the lines above.