RC car using a PS3 controller

I am trying to build an RC car controlled by a PS3 controller. so far I have this for the code.But it only spins in one direction. I am using a L293DNE H-bridge to control the motor spin direction.

help me please!

#include <PS3USB.h>
USB Usb;

PS3USB PS3(&Usb);

int EnablePin = 5;
int MotorPin1 = 4;
int MotorPin2 = 6;
int Forward;
int Backward;

//boolean printAngle;
//uint8_t state = 0;

void setup() {

pinMode(EnablePin, OUTPUT);
pinMode(MotorPin1, OUTPUT);
pinMode(MotorPin2, OUTPUT);

if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while(1); //halt
Serial.print(F("\r\nPS3 USB Library Started"));

void loop() {

if(PS3.PS3Connected || PS3.PS3NavigationConnected) {

if(PS3.getAnalogHat(LeftHatY) > 135) {
Forward = map(PS3.getAnalogHat(LeftHatY), 135, 255, 0, 255);
analogWrite(EnablePin, Forward);
//digitalWrite(EnablePin, HIGH);
digitalWrite(MotorPin1, HIGH);
digitalWrite(MotorPin2, LOW);

if(PS3.getAnalogHat(LeftHatY) < 120) {
Backward = map(PS3.getAnalogHat(LeftHatY), 120, 0, 0, 255);
analogWrite(EnablePin, Backward);
digitalWrite(MotorPin1, LOW);
digitalWrite(MotorPin2, HIGH);


analogWrite(EnablePin, 0);
digitalWrite(MotorPin1, LOW);
digitalWrite(MotorPin2, LOW);


You could add some more serial prints, to get an idea of what the sketch is doing.

The last person who posted with a problem with an L293 circuit had it wired wrong 9 ways from sunday. Draw the schematic with pen and paper and take a photo with your cell phone and post it. Take a photo of your circuit up close , showing the wiring and post that.