Better ![]()
Why do you do a digitalRead() ? If you set the output HIGH, then you know it is HIGH, if you set the output LOW, then you know it is LOW.
The hardest part of writing code is describing something from the real world in a logical way. If you can do that, then half the sketch is already written.
This is the most simple description.
Is button pressed ?
activate relay 1
wait 3 minutes
de-activate relay 1
activate relay 2
wait 1 minute
de-activate relay 2
That description is not complete. What happens if the button is pressed and never released ?
Do you want to add things to the sketch ? for example a blinking led ?