Does anyone happen to have a similar example for a python code when pressing a button a relay is turned on which is powering a motor to open a gate for 5 seconds and then closes by giving a signal to another relay which is connected with opposite positive and negative to the motor to close the gate ( this picture shows how i an going to try and connect the motor and relays) would i also be possible to add motion detection so if there would be motion the second relay isn't powered so the gate wouldn't close
Thanks