Time Delay Relay

Hi

Can someone please help, Im after a simple code to create a time delay relay function.

This is what I'm trying to achieve.

if a pin is set to HIGH
the arduino will count down a pre determined amount of time,
if that time expires it will react, (digitalWrite another pin HIGH)

eg. if (PINA == HIGH)
count down predetermined amount
if it expires
digitalWrite ( PINB, HIGH)

thanks in advance

Which part are you stuck on ?

If the program is doing nothing else but reading the input and controlling the relay the the much maligned delay() function will do what you want. If the program is doing other things then you will need to use millis() for timing.

More details required.

bern205:
Hi

Can someone please help, Im after a simple code to create a time delay relay function.

Coming here asking for a very simple sketch. Are you a lazy student asking other people to do your homework?
Look at inbuilt examples in Arduino IDE. This does almost exactly what you want. All you need to do is to add a single line

delay(milliseconds countdown);

somewhere in the code.