control of dc-motors using L293D and arduino uno

i want to move two dc-motors simultaneously for some time . how to code for this.

I am using L298N chip:
http://robotoid.com/appnotes/circuits-bridges.html
I guess it should be the same sketch to write to run your DC motor.

Heres is your chip:http://forum.arduino.cc/index.php/topic,15469.0.html

void setup(){
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);

void loop(){
digitalWrite(5,LOW);
digitalWrite(6,HIGH)
digitalWrite(9, LOW);
digitalWrite(10,HIGH);
}

satish_23: i want to move two dc-motors simultaneously for some time . how to code for this.

What is your arduino board? you should use a motor driver to make those motors turn :D :D

void setup(){
pinMode(5, OUTPUT);
void loop(){
digitalWrite(5,LHIGH);

connect your L298 board with ground to your Arduino. connect both of the enable pins on your L298 to pin 5 of your arduino.

this will turn on your L298 and run the motors at the same time for as long as your motor has power or the Arduino has power.

the output works just like the LED outputs in any of the examples.

if you want to try to light LED's, try some of the examples and once you are confident in turning the LED on and off, then connect your L298 to do the same thing.