Let's Make Robots!

L293D Motor Driver

Hey, can anyone tell me if the L293D motor driver chip can take an analog value to its input pins?

Or does it have to be a logical 1 or 0?

Just wondering if I can drive my motor at variable speeds with it, or if I only get one speed or no speed.

Here is a diagram of the chip:

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Do it like this

#define motor_left_fwd     5 //  a high on this pin drives motor forward

#define motor_left_rvs      6 //  a high on this pin drives motor backwards

If you are using [0] as a part of a constant name it may be confusing the compiler when it is set to interpret those brackets as an array element.

I think you should start by reading the datasheet. Then read it again :D

You should have used the search bar for information on this chip as there is already a tip/walkthrough written on this subject here:
http://letsmakerobots.com/node/2074

Have you enabled the motor? Have you got VS connected to +5V? Have you got VSS connected to the battery? What voltage is your battery? Have you got all your ground pins joined together? Your ground for your processor must be connected to the ground pins of the L293D.

You can provide it with "PWM" pulse width modulation at variable duty cycles.