I want to turn on two LEDs at the same time when a button is pressed and after 3 mins, it turns off. But I can't because if I do that into an if(), it turns on then waits for 3 mins and then the led turns off and after that it does the same with the other led.
Have you tried something with millis() as Robin2 wrote 8 months ago: How do I use two funcions simultaneously? - #3 by Robin2 - Programming Questions - Arduino Forum.
I want to turn on two LEDs at the same time when a button is pressed and after 3 mins, it turns off.
You turn on two LEDs. After 3 minutes do you want BOTH of them to turn off? Saying 'it' suggests that only one turns off.
Both on and both off at the same time is really easy. Post the program that you have tried and we can help.