motor driver (L293D ic) interfacing with arduino uno

Hi, I am doing a project using arduino uno ,where i need to show the output with motor rotations(clockwise and anticlock wise).So i have done the interfacing of the 12v DC motor using the L293d motor driver ic. But the problem i have got with this is the motor is rotating only in forward direction (i.e clock wise) it is not rotating in the anticlockwise direction. I have taken the code and also the connections from http://www.erfssn.org/tutorials/arduino/interfacing-dc-motor/ My connections to L293d icare as follows pin1- vcc(5v) pin2- Vcc(5v) pin3- output1 i.e connected to the motor +ve terminal pin4- gnd pin6- output2i.e connected to the motor's -ve terminal pin7- gnd pin8- Actually this should be connected to +12v powersupply(extrnal) but i dont have it at present ,so i have connected it to the +5v pin16-Vcc(5v) and the digital pin 7 of arduino to pin3 of L293d ic (i.e o/p 1) digital pin 6 of arduino to pin6 of L293d ic(i.e o/p 2) So with all these connections the motor is rotating only in clockwise direction,but i cant get my motor turned in anti clockwise. So please help if i`m wrong with connections or the code and correct me at the earliest

Hi, can you please post the code you are using ?? Also an image of your wiring would help..

Is pin5 also grounded? Why do you have pin7 grounded?

Take a look here: |282x500

Source:http://wiring.org.co/learning/basics/motorspeed.html

yes definitely thank u for ur response
int motor_forward = 7;
int motor_reverse = 6;

// the setup routine runs once when you press reset:
void setup()
{
// initialize the digital pin as an output.
pinMode(motor_forward, OUTPUT);
pinMode(motor_reverse, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(motor_forward,1); //terminal D1 will be HIGH
digitalWrite(motor_reverse,0); //terminal D2 will be LOW
delay(5000); //creates a 5 seconds delay
//Motor will rotate in forward direction for 5 seconds
digitalWrite(motor_forward,0); //terminal D1 will be LOW
digitalWrite(motor_reverse,1); //terminal D2 will be HIGH
delay(5000); //creates a 5 seconds delay
//Motor will rotate in reverse direction for 5 seconds
digitalWrite(motor_forward,0); //terminal D1 will be LOW
digitalWrite(motor_reverse,0); //terminal D2 will be LOW
delay(5000); //creates a 5 seconds delay
//Motor will stop rotating for 5 seconds
//again the loop() will run from the begining until the board is turned OFF
}
coming to the reason for grounding of pin7 as it is input 2 and as given in the website
http://www.erfssn.org/tutorials/arduino/interfacing-dc-motor/
connecting the input 1 to high level i.e VCC(5v) and input 2 to Low level makes the motor rotate in forward direction . I’m not sure about it but the site from where i have taken tha code and circuit says that 4 and 5 are internally grounded.
But even bygrounding manually the 5thpin of ic i have tried but it didnt work
All my connections here are done on the bread board.

prjct.jpg

Your code is fine, i would suggest you try the wiring explained here http://communityofrobots.com/tutorial/kawal/how-drive-dc-motor-using-l293d-arduino