4WD with XY-joystick and L293D issue

You might find use for this example sketch I wrote a while back:

const byte XPotPin = A0;
const byte YPotPin = A1;

const int PWM_LIMIT = 255;
const int DEAD_ZONE = 10;

void loop()
{
  int speedInput = analogRead(YPotPin); // Forward/Reverse
  int yawInput = analogRead(XPotPin); // Left/Right turn

  // map 'speed' to the range -PWM_LIMIT (backward), +PWM_LIMIT (forward)
  speedInput = map(speedInput, 0, 1023, -PWM_LIMIT, PWM_LIMIT);
  yawInput = map(yawInput, 0, 1023, -PWM_LIMIT, PWM_LIMIT);

  // Put in dead zones
  if (speedInput > -DEAD_ZONE && speedInput < DEAD_ZONE)
    speedInput = 0;
  if (yawInput > -DEAD_ZONE && yawInput < DEAD_ZONE)
    yawInput = 0;

  int leftSpeed = speedInput + (YAW_SENSITIVITY * yawInput);
  int rightSpeed = speedInput - (YAW_SENSITIVITY * yawInput);

  // neither motor can go faster than maximum speed
  leftSpeed = constrain(leftSpeed, -256, 256);
  rightSpeed = constrain(rightSpeed, -256, 256);

  // For positive speeds, motor goes forward at speed
  // For negative speeds, motor goes backward at -speed
  // For zero speeds, turn off motor