Hello, ( I have searched for a few days and tried to write a program but failed in both aspects.) with that said... I have a project that I need some help with. I have an arduino micro and I am completely new to programing and have no idea what i am doing on the programing side of this project. What I would like to do is run a 12vDC motor bidirectionally for a set amount of time. and have it be triggered by a voltage signal (or ground???) to the arduino micro. So when voltage is applied to (input pin) the motor spins cw for (time) then stops even though power (or ground???) is still applied to (input pin). When power is removed from (input pin) motor spins ccw for (time) then stops until power is applied again. If i can be steered in the right direction or if someone is nice enough to write the program i would be very thankful.
I attached a picture to show my setup/ or what i think is correct. im not sure completely as i am somewhat new to semiconductors