Help controlling relay with timer countdown

Hi i am pretty sure that this is a fairly simple task, however i am finding it very difficult to work out actually what code to write in the sketch. please help

I have a sketch timer countdown with setting time to activate buzzer. first of all, i can set hours, minutes, and seconds, then when i press the start button, timer start to countdown, when the timer finished, relay will activate buzzer.

I want to modify the sketch by adding one more relay to activate light bulb. i’ve tried but always failed.
so relay to activate light bulb = relay 1
relay to activate buzzer = relay 2

the task should be like this. first of all, i can set hours, minutes, and seconds, then when i press the start button, timer start to countdown, relay 1 will activate light bulb, when the timer finished, relay 1 will deactivate light bulb, then relay 2 will activate buzzer as the alarm.

i use :
pin 8 start button
pin 9 up button
pin 10 down button
pin 12 to activate relay 1
pin 13 to activate relay 2

please help where i have to add code the sketch?

here is my sketch

#include <LiquidCrystal.h>
 
int hours = 0; // start hours
int minutes = 0; //start min
int seconds = 0; //start seconds
 
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //<--removed- Different LCD manufacture
LiquidCrystal lcd(2,3,4,5,6,7);//Pin Code for Arduino SainSmart LCD 1602 KeyPad
 
void setup() {
 pinMode(8, INPUT);digitalWrite(8,HIGH); 
 pinMode(9, INPUT);digitalWrite(9,HIGH); 
 pinMode(10, INPUT);digitalWrite(10,HIGH); 
 pinMode(12, OUTPUT);digitalWrite(12,HIGH); 
 pinMode(13, OUTPUT);digitalWrite(13,HIGH); 
}
 
void loop() {
  
 lcd.begin(16, 2);
 lcd.print("Count Down Timer ");
 delay(150);
 
 // lcd.scrollDisplayLeft();
 // wait a bit:
 
 if(digitalRead(9)==LOW||digitalRead(10)==LOW)
{delay(200);
  while(1)
  {
    if(digitalRead(9)==LOW){hours++;}
    if(digitalRead(10)==LOW){hours--;}
    if(digitalRead(8)==LOW){delay(200);break;}
    lcd.begin(16, 2);lcd.print("Setting H      ");
    lcd.setCursor(4, 2);lcd.print(hours);
    delay(200);
  }
  while(1)
  {
    if(digitalRead(9)==LOW){minutes++;}
    if(digitalRead(10)==LOW){minutes--;}
    if(digitalRead(8)==LOW){delay(200);break;}
    lcd.begin(16, 2);lcd.print("Setting Mnt    ");
    lcd.setCursor(4, 2);lcd.print(minutes);
    delay(200);
  }
  while(1)
  {
    if(digitalRead(9)==LOW){seconds++;}
    if(digitalRead(10)==LOW){seconds--;}
    if(digitalRead(8)==LOW){delay(200);break;}
    lcd.begin(16, 2);lcd.print("Setting Sec    ");
    lcd.setCursor(4, 2);lcd.print(seconds);
    delay(200);
  }
  while(1)
  {
   program(); 
  }
}
}

void program()
{
  while (hours > 0 || minutes > 0 || seconds >= 0) {
 
 lcd.setCursor(4, 2);
 
 (hours < 10) ? lcd.print("0") : NULL;
 lcd.print(hours);
 lcd.print(":");
 (minutes < 10) ? lcd.print("0") : NULL;
 lcd.print(minutes);
 lcd.print(":");
 (seconds < 10) ? lcd.print("0") : NULL;
 lcd.print(seconds);
 lcd.display();
 stepDown();
 delay(1000);
 }
}
 
void stepDown() {
 if (seconds > 0) {
 seconds -= 1;
 } else {
 if (minutes > 0) {
 seconds = 59;
 minutes -= 1;
 } else {
 if (hours > 0) {
 seconds = 59;
 minutes = 59;
 hours -= 1;
 } else {
 trigger();
 }
 }
 }
}
 
void trigger() {
 lcd.clear(); // clears the screen and buffer
 lcd.setCursor(5, 1); // set timer position on lcd for end.
 
 lcd.println("END ");
 digitalWrite(13, LOW);
 delay(1000);
 lcd.display();
}

Is this your code?

.

where ever in your Code (cant see it) when the time ends and its time for ligth bulb ad then for alarm just add before activating buzzer

digitalWrite(12,HIGH);
delay (30000)

so it shuld look like > time runs to end

digitalWrite(12,HIGH);
delay (30000)
digitalWrite(13,HIGH);

after lets say 30 seconds light will stop and buzzer will start

Which board? On some boards pin 13 is build in LED.

larryd:
Is this your code?

.

no, my friend help me for this code

hoooobix:
where ever in your Code (cant see it) when the time ends and its time for ligth bulb ad then for alarm just add before activating buzzer

so it shuld look like > time runs to end

after lets say 30 seconds light will stop and buzzer will start

i’ve tried to put this code to the sketch, the task running as well, but the timer countdown is disappear from the LCD

void program()
{
  while (hours > 0 || minutes > 0 || seconds >= 0) {
 
 lcd.setCursor(4, 2);
 
 (hours < 10) ? lcd.print("0") : NULL;
 lcd.print(hours);
 lcd.print(":");
 (minutes < 10) ? lcd.print("0") : NULL;
 lcd.print(minutes);
 lcd.print(":");
 (seconds < 10) ? lcd.print("0") : NULL;
 lcd.print(seconds);
 lcd.display();
  stepDown();
 delay(1000);
 digitalWrite(12, LOW); // <-------- I add this one

Juraj:
Which board? On some boards pin 13 is build in LED.

arduino uno R3, yes it is

Juraj:
Which board? On some boards pin 13 is build in LED.

That would not prevent it being used for a relay.

Pin 12 is one of your LCD pins, use an alternate pin for relay.