A simple driver for a 12-volt motor can be made using conventional electronic components as in electronic diagram below.
The circuit has two inputs and, if both inputs are in logic state 1 (12 V) nothing happens. Once one of the input voltage becomes 0 transistor T5 enter in conduction state. As a result both T1 and T4 will conduct and the motor will spin in a certain sense.
When T5 is passed in conduction, T1 will conduct, in the same time, a current path through the base of T1 to T4 passing through transistor T5 so this will lead.
D5 and D6 ensure that nothing happens if both inputs are shorted to the ground simultaneously. If the input is zero volts A lead both T1 and T4 and the anode of D6 is connected to +12 V. If the input B is now short circuited, the T6 can not conduct because his is maintained at a positive voltage.
Pulse width modulation can be used to control motor speed. This means that the injected signal at input A or B is not continuous but a series of pulses whose width can be varied. As the pulse is narrow so the engine spins faster.