Turn ON a led during a defined time

Hy guys,

Is it possible to turn ON a LED (or do any action) during a defined time (variable) without using "delay(variable)" ?

I have 3 captors who register each a certain value, and it have to control 3 LED. I want them to switch ON at the same time, and switch OFF depend of my 3 values.

Thanks a lot !

Is it possible to turn ON a LED (or do any action) during a defined time (variable) without using “delay(variable)” ?

Yes. Look at the BlinkWithoutDelay example in the IDE.

The principle used is as follows
Record the start time of an activity
Check frequently (each time through loop() is good) whether the current time minus the start time is greater than the required interval
If yes then take the required action(s)
Else do other things such as reading sensors

See also the demo several things at a time.

...R