How to make two wheels turn only for a particular amount of time?
Use the delay() function.

Pseudo code as follows:

1) Turn clockwise motor on;
2) Turn counterclockwise motor on;
3) delay(&lt;time&gt;);
4) Turn CW motor off;
5) Turn CCW motor off.