Create code to spin a motor

I'm working on a project where when I press a button a motor spins in the clockwise direction for a certain amount of time and then stops, and then the next time that I press the button, the motor spins in the counterclockwise direction for a period of time then stops. I'm having trouble coding this and would like some help. This is probably super easy but I am new to arduino.

Have You read this topic, General Guidance and How to use the forum? There it tells how to attach code, digrams etc.

Read it, attach the best code effort using code tags. Also tell what is happening and You want to happend.

We're a bit short of information. What sort of motor? What motor driver are you going to use? What Arduino are you using? How will it all be powered?

Have you done any searching because you're not the first person wanting to do this. The Button example in the IDE will get you reading a button and doing something when it is pressed. Whatever motor driver you are using will have example programs

And when you have found or written some code then post it here. We're not really a free program writing service but once you've made some attempt we'll gladly help you to get it working.

Steve

arduinomasterEDD:
I'm working on a project where when I press a button a motor spins in the clockwise direction for a certain amount of time and then stops, and then the next time that I press the button, the motor spins in the counterclockwise direction for a period of time then stops. I'm having trouble coding this and would like some help. This is probably super easy but I am new to arduino.