With the Arduino, you can control the lights. When you press the switch, the circuit is completed, and the light will be turned on. The red light and the green light will blink in turn.
I’ve tried two codes to make them blink in different ways. So, I took two videos of them.
I don’t know why I cannot use the code snippets, so I just put one of my code here. I will put it into the code snippets, if it could work.