PRACTICAL (and SAFE) H-BRIDGE for MOTOR DRIVE
I have noticed several people using an H-bridge schematic (commonly circulated on the web) that will work, but if both inputs are high at the same time, can throw a short across the motor power supply. As long as they never let that happen, these circuits will work, but I consider it unsafe. Since many people here have different levels of expertise in both hardware and software, it is better to use an arrangement that prevents accidentally shorting anything.
Here is a circuit layout with 4 transistors that will drive a motor, but without the chance of shorting the power. In my circuit below, when Q1 is on, Q3 must be off, and when Q2 is on, Q4 must be off.
The reverse EMF diodes can be any fast switching diodes, but Schottky diodes would be preferred. They switch in like 100 picoseconds --(one ten billionth of a second.)