I have this project to make to demonstrate a gate opening and closing.

I have open, close, and stop buttons. When I press the open button, an LED should blink for 5 seconds as warning indicating the gate will move and after 5 seconds the motor (represented by LED) should turn on. The warning light should still bear blinking in all time until the stop button is pressed.

I need a little help with making the timer.


You can use millis()

I used the mills command to blink the LED. because if I use delay to blink LED it will interrupt the whole program. The problem is that Iā€™m not able to start another led after 5 seconds. Here is an example of my program

industrial_gate.ino (2 KB)