WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

L293D motor driver and SN754410 motor driver

Support for the L293D and SN754410.
These devices have exactly the same pin-outs and so you can swap between them without any hardware/code changes. The only difference is that SN754410 can supply 1A versus 0.6A for the L293D. Both devices can supply double the current for a fraction of a second.
The SN754410 is a more modern device and so tends to be cheaper to buy. "More current and cheaper" = "No brainer"! If you decide to go with the L293D then make sure you buy one with the 'D' at the end as this has the internal diodes fitted meaning that you don't need to add any external components.
There are two different ways to use each motor: 3 pin mode or 2 pin mode. Each has advantages and disadvantages. If you have lots of available IO pins then my recommendation would be to use '3 Pin Mode'.
If you want then you can use a mixture of both 3 pin and 2 pin modes.
3 Pin Mode
L293D3pin.jpg
This requires one hardware PWM pin plus 2 general purpose digital output pins per motor. The benefit of this mode is that it can support all the possible motor drive states required by WebbotLib ie: forward, reverse, brake and coast. Variable speed is achieved by alternating between 'full speed' and 'coast'.
 
seperator.jpg
2 Pin Mode
L293D2pin.jpg
This requires one hardware PWM pin plus 1 general purpose digital output pin. The drawback of this mode is that it doesn't support the 'coast' motor drive state. Consequently to achieve variable speed settings the motor alternates between 'full speed' and 'brake' via the PWM pin. This places the motor under some stress and will 'wear out' the motor more quickly than the 3 Pin Mode.
 
seperator.jpg
Example
Just use the generic example in Actuators
Function Summary

Valid XHTML 1.0 Transitional