//for a little example:
long = ref1;
if (millis() - ref1 >= 15000) //for 15 seconds...
{
ref1 = millis() ;
digital.Write( pin no, HIGH);
}
else { whatewer you want} //Is not necessary/optional
What are you working with? An MCU of some sort, sounds like?
If so, you need to use your MCU's interrupt system, in combination with a timer peripheral. You want to set a timer to go off in the future, interrupt the CPU and then you would set the pin to be low from the interrupt handler. Some timer peripherals can do this automatically too.
It might help to know what is your exact platform, but most MCUs do have both a timer and an interrupt system.
Ok, thanks for the example.
Thanks a lot. I'll try 'millis' method. https://arduinogetstarted.com/faq/how-to-use-millis-instead-of-delay